.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MsgBox Displays the Data but DataGridView Doesn't

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :Windows Application

This little bit of code ...

Sub DisplayStuff()
    With Group01(NextRDi)
      Dim row() As String = {.Level, .name, .PicText, .offset.ToString, .SrcLen.ToString}
      MsgBox(.Level & " " & .name & " " & .PicText & " " & .offset.ToString & " " & .SrcLen.ToString)
      Dim rowS() As Object = {row}
    End With

  End Sub

... results in MsgBox output which looks correct.  But in my DataGridView (dgv) I see "System.String[]" for all rows in the first column (level) and all of the other values (all rows and all columns) are blank.

Can someone please tell me what I failed to do or what I am doing wrong?

Thanks,  Bob


View Complete Post

More Related Resource Links

When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

MVC view displays Preveously loaded data only



1. May be it loading page either from History or Chache memory.

2. When anonymous user open about-us page or Home page then we display only 4 menus. And immediatly Normal user logs in and

open about-us page or Home page it again display only 4 menus instead displaying all menus available for registered user. I

have used the PartialView and render it in Master page(use the code Html.RenderPartial("Menus")) see the following code...

<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%: ""%>
<div id="menucontainer">
    <ul id="menu">       
            <%  If Request.IsAuthenticated = False Then%>
                <li><%= Html.ActionLink("Home", "Index", "Home")%></li>
                <li><%= Html.ActionLink("Register", "Register", "Account")%></li>

CheckedListBox displays System.Data.DataRowView on one machine

As I was writing this post I solved my problem. Now I will share the solution for anyone who may stumble across this legacy cr*p. I inherited an old VB.NET application written in the old Visual Studio .Net against the 1.0 framework. Recently we had to rebuild a couple of machines and redeploy the app. We have CheckedListBox controls bound using the DataSource property and suddenly all we could see was System.Data.DataRowView in the list on these machines. All the forums out there tell you that binding the items with the DataSource property is not supported by Microsoft and offer code fixes, which we obviously do not want to do. I installed the .Net Framework 1.0 redistributable and fixed it right up. Which is a little strange because one of the machines it still works on only has 1.1. But there you have it  I actually tested this on another machine by installing 1.1 first, which did not fix the problem, but installing 1.0 did. And another interesting thought. The executable and its class library dependency reside in a network share. After installing the 1.0 framework I had to run a Caspol.exe command to grant privs to the share or the executable could not access the library. The app functioned fine without the Caspol.exe command (except the ListBox of course) prior to installing the 1.0 framework. Strange stuff...Hope this helps someone someday.

Calculated date field displays differently in List View and Data View web parts

In SharePoint GUI I created a simple custom list with a calculated Date/Time field (Due).  The calculation is =[Created]+7.  I'm trying to display this data on a page using a DVWP.  But first, for testing purposes, I also created a second calculated Date/Time (TestCreate) field in my custom list that is simply =[Created]. In the List View from within SharePoint, the dates show as expected (for example): Created = 8/12/2010 3:45 PM Due = 8/19/2010 3:45 PM TestCreate = 8/12/2010 3:45 PM In SharePoint Designer, I added a Data View web part and the above three data elements (each configured to display mm/dd/yyyy hh:mm:ss tt).  I see the time displayed for the example list item as: Created = 8/12/2010 3:45:30 PM Due = 8/19/2010 10:45:00 AM TestCreate = 8/12/2010 10:45:00 AM I've tested a couple scenarios and the calculated fields always display five hours in the past (along with dropping the seconds).  It seems like the DVWP is returning the date in a different time zone (with no seconds).  The lcid is set right (1033).  I didn't see any time zone settings for the DVWP specifically.  I'm basically stuck.  Could someone help me figure this one out. Thanks.

Sys.Data.DataContext.saveChanges method doesn't send update to server after DataServiceException ex

Hello,I have a page with a simple form that updates a single record in a table in my database.The database is accessed via WCF Data Services. To load and save data from/to the server, I usethe Sys.Data.DataContext object provided by the ASP.NET AJAX library. When the "save" button on theform is clicked, I use the saveChanges method of the Sys.Data.DataContext object to send all changes to the server.Also, at the server side, I use an interceptor that checks the "Price" fields of the record, and throws a DataServiceException exception when the contents of the field is a negative number.Both the JavaScript and the interceptor (in C#) are copied below.Here is the interesting thing:When I enter a negative price in the form, the interceptor throws the exception and my form shows an error message. Good.However, if I then make one of the other fields in the form a bit shorter (for example from "abcd" to "abc"),the saveChanges method doesn't send the data to the server. But it does call the success callback that I passed in to saveChanges, creating the impressionthat the data has been saved. This happens while the Price field is still negative. I used Fiddler to make sure thatno message is sent to the server. Also, the interceptor doesn't get executed.The weird thing is that if I make one of the fields a bit longer instead (for example &q

datagridview add data a column at a time

How do I add to a datagridview a column at a time? I see at http://msdn.microsoft.com/en-us/library/5s3ce6k8.aspx that it is possible to do it a row at a time. I was looking for something similar.      

Stupid developer tricks - When a data type overflow doesn't cause an overflow

Build a very basic cube that has a dimension with a hierarchy and a single measure.  For example, a time dimension with Year, Quarter, Month, Date along with a quantity sold.  The quantity sold is an integer in your database. Now, load up your database with test data such that the quantity when rolled up to a quarter level will be just less than the maximum value for an integer.  Process your cube and see the absolutely stupid value that gets displayed for a year. For those of you reading along and not wanting to build a cube to see what happens, here it is in a nutshell. To make the math simple, we'll use 2 billion as the max value for an int and -2 billion and the min value.  Say for example that the quantity sold for each quarter was 1 billion units.  When you look at the cube from the quarter on down, you see nice, neat POSITIVE values.  But, when you look at the quantity sold for the year, SSAS reports the quantity sold as 0. No, it didn't substitute 0 for a data type overflow (4 billion exceeds the 2 billion max).  Instead, the developer of this "feature" decided that it would be a really nice idea to just ignore the fact that you had a data type overflow and just treat the range of values as a looping structure.  So, his code said, take the aggregated value, run it all the way up to the last value in the range and tak

Need advice to display data in DataGridView, then edit dan save the data

I am Winform Beginner. To display data using DataGridView is ok with me. How the best way to select row in DataGridView, then edit and save. Did this DataGridView can editable? or Once row in DataGridView is selected, then popup another form to perform edit transaction. Really need advice and good example

Repeat Report Item with Data Region on Every Page - doesn't work

Hi All, The Repeat Report Item with Data Region on Every Page property does not work - or atleast not the way i would expect it to. My report contains a header which is the Report Name. In the report body - I have text box with the company name, pulled from a data set. Below the company name i have a line, followed by a text box displaying the selected parameters. When I run the report, the first page displays all information as expected. However, subsequent pages only display the report header (report name) with the table butted up against it. I have tried setting the Repeat Report Item with Data Region on Every Page to true (and the data region to my table) for the Company Name text box, the line, and the parameters text box. This has no affect i.e. page 2, page n... are not printing the three items. Any suggestions much appreciated. Thanks.  Clay

How to refresh data in the DataGridView by using a Timer?

Hi all I am refreshing my DataGridView by calling using the code below: protected void Timer1_Tick(object sender, EventArgs e) { UpdatedTime.Text = DateTime.Now.ToLongTimeString(); FillDataGridView(); } protected void FillDataGridView() { DataSet objDs = new DataSet(); SqlConnection myConnection = new SqlConnection(WebConfigurationManager.ConnectionStrings["Test"].ConnectionString); SqlDataAdapter myCommand; string select = "SELECT * FROM TableLogging"; myCommand = new SqlDataAdapter(select, myConnection); myCommand.SelectCommand.CommandType = CommandType.Text; myConnection.Open(); myCommand.Fill(objDs); GridView1.DataSource = objDs; GridView1.DataBind(); } However I want to use templates in the DataGridView like this: <asp:TemplateField HeaderText="InstanceID" SortExpression="InstanceID"> <ItemTemplate> <asp:Label ID="lblInstanceID" runat="server" Text='<%# Eval("instanceID") %>' /> </ItemTemplate> </asp:TemplateField> So I would NOT be calling FillDataGridView() from Timer1_Tick. My question is: what do I have to add inside Timer1_Tick so that it will refresh my DataGridView (the one with the templates) Thank you! 

ajax accordion with gridview doesn't display data


hi guys,

im trying to display some data using a gridview inside ajax accordion. i have called the method accordion1_itemBound at the accordion properties but it still doesnt show me any data at the gridview... i check all my query string and everything seems find. would really appreciate if someone could check my code and teach me how to solve it.

below are my codes at the source page

    <form id="form1" runat="server">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProrsumDBConnectionString %>" 
            SelectCommand="SELECT [reviewID], [comments], [reviewDate] FROM [Review]">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <asp:DataList ID="dlProdCatalog" runat="server">
                <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("pictureURL") %>' />
                <br />
                Tour Title:
                <asp:Label ID="tourTitle

returning data as hyperlink works but doesn't work


Please help. I have a form that searches my database and returns results well but each record contains a cell with a link to another html page. The problem is that whether I place the html pages in the same directory as the .asp codes or in a separate directory with the link being an absolute URL, the action of clicking on the link fails to redirect. Is it possible?

The returns are addresses and the link in each record is to it's own address page with google map.

Insert data to ms access from datagridview using dataset


please give me sample code for insert data to MS ACCESS  from grid view using dataset

adhoc reporting - data doesn't refresh on date range change


I created an adhoc report model using SQL Server 2008 reporting services. I am using data from a SQL 2000 database sitting on a SQL 2000 server. I created reports with start date and end date parameters, everything worked fine.


Now my ad hoc report model uses a SQL 2000 database (this database is a replication of the database I was using)  sitting on a SQL 2008 server. When I change parameters like start date and end dates, data doesn’t refresh. It shows the same data for any date range.


Has anyone seen this problem? What could be done to fix the issue. Is there any setting on the SQL server to fix this?



is it possible to make button can print my DataGridView Data ?????

i have a form include datagrid so i wanna print the queried data on it

how i can do that

DataGridView object column 'data type' assignment

How do I assign a 'data type' to an 'unbounded' datagridview object

Custom Data Processing Extension doesn't show but should be registered correctly.



I have a custom data processing extension that i can't see to get to work. I followed the steps like in :http://msdn.microsoft.com/en-us/library/ms155086.aspx to register the extension. Yet the extension does not show up in the data source list.

It's an extension made for ssrs 2008 and I want to use it on a SSRS 2008R2 instance. I don't have any reasons to believe that I did not configure the extension correctly, it's the same as the article and and the same on my 2008 instance.

I am using Reporting Services standard edition 2008 R2 with cumulative fix patch 4 so that should support extensibility.

The data sources that I migrated from 2008 that still refer to the extension give a message saying that the extension is not registered or configured correctly. But i swear I did it right.

Any other extension that I use did register fine, none of them are DPE's though.


My config:


  <Extension Name="SecurityDataProce
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend