Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How do i debug a datagrid problem ?

Reply
Thread Tools

How do i debug a datagrid problem ?

 
 
Tony Girgenti
Guest
Posts: n/a
 
      09-28-2006
Hello.

I'm developing and testing a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

I'm trying to display a datagrid on my web form using this code:
Me.tripsDataGrid.DataSource = Me.tripsDataSet
Me.tripsDataGrid.DataMember =
Me.tripsDataSet.tripsTable.ToString
Me.tripsDataGrid.DataBind()

It displays the DataGrid on the form with the column headers but no data
rows. The data is in the tripsTable rows because i can display them in the
debugger.

How do i debug this to figure out why it is not populating the datagrid ?

Any help would be gratefully appreciated.

Thanks,
Tony


 
Reply With Quote
 
 
 
 
Brian Foree
Guest
Posts: n/a
 
      09-28-2006
I don't know if this would make a difference, but everything looks OK in
your code with the possible exception of the following line:

Me.tripsDataGrid.DataMember = Me.tripsDataSet.tripsTable.ToString

I'd suggest replacing the right side of the expression with the name of the
table as a String, like so (I'm guessing at the name of the table within
your DataSet):

Me.tripsDataGrid.DataMember = "trips"

The reason I'm suggesting this is because I seem to remember a similar
problem that was related to the DataMember being set incorrectly.

You could also set a breakpoint on this line (without the modification), run
the app in Debug mode and see what "Me.tripsDataSet.tripsTable.ToString"
evaluates to at that point. I did notice that the ToString method of a
System.Data.DataTable returns "the TableName and DisplayExpression, if there
is one as a concatenated string", so one possibility is that there is a
DisplayExpression, which would cause problems when you assign the
DataMember.

If my suggestion works and you still want to assign the DataMember
dynamically, you could try Me.tripsDataSet.tripsTable.TableName, which
contains just the name of the table as a String.

"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
news:...
> Hello.
>
> I'm developing and testing a web application using VS.NET 2003, VB, .NET
> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
> computer. I'm using a web form.
>
> I'm trying to display a datagrid on my web form using this code:
> Me.tripsDataGrid.DataSource = Me.tripsDataSet
> Me.tripsDataGrid.DataMember =
> Me.tripsDataSet.tripsTable.ToString
> Me.tripsDataGrid.DataBind()
>
> It displays the DataGrid on the form with the column headers but no data
> rows. The data is in the tripsTable rows because i can display them in
> the debugger.
>
> How do i debug this to figure out why it is not populating the datagrid ?
>
> Any help would be gratefully appreciated.
>
> Thanks,
> Tony
>



 
Reply With Quote
 
 
 
 
Tony Girgenti
Guest
Posts: n/a
 
      09-28-2006
Hello Brian.

I tried all of your suggestions and nothing worked. However, i did notice
that the line "Me.tripsDataSet.tripsTable.TableName" does yield the correct
table name, so i will probably stay with that in my coding.

All i need to do now is figure out why the grid is empty.

Thanks,
Tony

"Brian Foree" <> wrote in message
news:...
>I don't know if this would make a difference, but everything looks OK in
>your code with the possible exception of the following line:
>
> Me.tripsDataGrid.DataMember = Me.tripsDataSet.tripsTable.ToString
>
> I'd suggest replacing the right side of the expression with the name of
> the table as a String, like so (I'm guessing at the name of the table
> within your DataSet):
>
> Me.tripsDataGrid.DataMember = "trips"
>
> The reason I'm suggesting this is because I seem to remember a similar
> problem that was related to the DataMember being set incorrectly.
>
> You could also set a breakpoint on this line (without the modification),
> run the app in Debug mode and see what
> "Me.tripsDataSet.tripsTable.ToString" evaluates to at that point. I did
> notice that the ToString method of a System.Data.DataTable returns "the
> TableName and DisplayExpression, if there is one as a concatenated
> string", so one possibility is that there is a DisplayExpression, which
> would cause problems when you assign the DataMember.
>
> If my suggestion works and you still want to assign the DataMember
> dynamically, you could try Me.tripsDataSet.tripsTable.TableName, which
> contains just the name of the table as a String.
>
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> news:...
>> Hello.
>>
>> I'm developing and testing a web application using VS.NET 2003, VB, .NET
>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
>> computer. I'm using a web form.
>>
>> I'm trying to display a datagrid on my web form using this code:
>> Me.tripsDataGrid.DataSource = Me.tripsDataSet
>> Me.tripsDataGrid.DataMember =
>> Me.tripsDataSet.tripsTable.ToString
>> Me.tripsDataGrid.DataBind()
>>
>> It displays the DataGrid on the form with the column headers but no data
>> rows. The data is in the tripsTable rows because i can display them in
>> the debugger.
>>
>> How do i debug this to figure out why it is not populating the datagrid ?
>>
>> Any help would be gratefully appreciated.
>>
>> Thanks,
>> Tony
>>

>
>



 
Reply With Quote
 
Brian Foree
Guest
Posts: n/a
 
      09-28-2006
Are you loading the data into the table before you call the DataGrid's
DataBind method? I know you said that the data is in the tripsTable rows
because you can display them in the debugger, but did you check that just
before the DataBind call?

"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
news:...
> Hello Brian.
>
> I tried all of your suggestions and nothing worked. However, i did notice
> that the line "Me.tripsDataSet.tripsTable.TableName" does yield the
> correct table name, so i will probably stay with that in my coding.
>
> All i need to do now is figure out why the grid is empty.
>
> Thanks,
> Tony
>
> "Brian Foree" <> wrote in message
> news:...
>>I don't know if this would make a difference, but everything looks OK in
>>your code with the possible exception of the following line:
>>
>> Me.tripsDataGrid.DataMember = Me.tripsDataSet.tripsTable.ToString
>>
>> I'd suggest replacing the right side of the expression with the name of
>> the table as a String, like so (I'm guessing at the name of the table
>> within your DataSet):
>>
>> Me.tripsDataGrid.DataMember = "trips"
>>
>> The reason I'm suggesting this is because I seem to remember a similar
>> problem that was related to the DataMember being set incorrectly.
>>
>> You could also set a breakpoint on this line (without the modification),
>> run the app in Debug mode and see what
>> "Me.tripsDataSet.tripsTable.ToString" evaluates to at that point. I did
>> notice that the ToString method of a System.Data.DataTable returns "the
>> TableName and DisplayExpression, if there is one as a concatenated
>> string", so one possibility is that there is a DisplayExpression, which
>> would cause problems when you assign the DataMember.
>>
>> If my suggestion works and you still want to assign the DataMember
>> dynamically, you could try Me.tripsDataSet.tripsTable.TableName, which
>> contains just the name of the table as a String.
>>
>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>> news:...
>>> Hello.
>>>
>>> I'm developing and testing a web application using VS.NET 2003, VB, .NET
>>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
>>> computer. I'm using a web form.
>>>
>>> I'm trying to display a datagrid on my web form using this code:
>>> Me.tripsDataGrid.DataSource = Me.tripsDataSet
>>> Me.tripsDataGrid.DataMember =
>>> Me.tripsDataSet.tripsTable.ToString
>>> Me.tripsDataGrid.DataBind()
>>>
>>> It displays the DataGrid on the form with the column headers but no data
>>> rows. The data is in the tripsTable rows because i can display them in
>>> the debugger.
>>>
>>> How do i debug this to figure out why it is not populating the datagrid
>>> ?
>>>
>>> Any help would be gratefully appreciated.
>>>
>>> Thanks,
>>> Tony
>>>

>>
>>

>
>



 
Reply With Quote
 
Tony Girgenti
Guest
Posts: n/a
 
      09-28-2006
Brian.

Yes. I just checked it again. Very strange. When i use this statement:
Me.tripsDataGrid.DataSource = Me.tripsDataSet

It display the empty grid with the column name across the top.

If i use this statement:
Me.tripsDataGrid.DataSource = Me.tripsDataSet.DataSetName

It displays the grid with one column named "Item" and puts the name of the
dataset under it one letter at a time like this:
t
r
i
p
s
D
S

Thanks,
Tony

"Brian Foree" <> wrote in message
news:...
> Are you loading the data into the table before you call the DataGrid's
> DataBind method? I know you said that the data is in the tripsTable rows
> because you can display them in the debugger, but did you check that just
> before the DataBind call?
>
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> news:...
>> Hello Brian.
>>
>> I tried all of your suggestions and nothing worked. However, i did
>> notice that the line "Me.tripsDataSet.tripsTable.TableName" does yield
>> the correct table name, so i will probably stay with that in my coding.
>>
>> All i need to do now is figure out why the grid is empty.
>>
>> Thanks,
>> Tony
>>
>> "Brian Foree" <> wrote in message
>> news:...
>>>I don't know if this would make a difference, but everything looks OK in
>>>your code with the possible exception of the following line:
>>>
>>> Me.tripsDataGrid.DataMember = Me.tripsDataSet.tripsTable.ToString
>>>
>>> I'd suggest replacing the right side of the expression with the name of
>>> the table as a String, like so (I'm guessing at the name of the table
>>> within your DataSet):
>>>
>>> Me.tripsDataGrid.DataMember = "trips"
>>>
>>> The reason I'm suggesting this is because I seem to remember a similar
>>> problem that was related to the DataMember being set incorrectly.
>>>
>>> You could also set a breakpoint on this line (without the modification),
>>> run the app in Debug mode and see what
>>> "Me.tripsDataSet.tripsTable.ToString" evaluates to at that point. I did
>>> notice that the ToString method of a System.Data.DataTable returns "the
>>> TableName and DisplayExpression, if there is one as a concatenated
>>> string", so one possibility is that there is a DisplayExpression, which
>>> would cause problems when you assign the DataMember.
>>>
>>> If my suggestion works and you still want to assign the DataMember
>>> dynamically, you could try Me.tripsDataSet.tripsTable.TableName, which
>>> contains just the name of the table as a String.
>>>
>>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>>> news:...
>>>> Hello.
>>>>
>>>> I'm developing and testing a web application using VS.NET 2003, VB,
>>>> .NET
>>>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
>>>> computer. I'm using a web form.
>>>>
>>>> I'm trying to display a datagrid on my web form using this code:
>>>> Me.tripsDataGrid.DataSource = Me.tripsDataSet
>>>> Me.tripsDataGrid.DataMember =
>>>> Me.tripsDataSet.tripsTable.ToString
>>>> Me.tripsDataGrid.DataBind()
>>>>
>>>> It displays the DataGrid on the form with the column headers but no
>>>> data rows. The data is in the tripsTable rows because i can display
>>>> them in the debugger.
>>>>
>>>> How do i debug this to figure out why it is not populating the datagrid
>>>> ?
>>>>
>>>> Any help would be gratefully appreciated.
>>>>
>>>> Thanks,
>>>> Tony
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Tony Girgenti
Guest
Posts: n/a
 
      09-29-2006
Hello Brian.

I deleted all my data controls and started over and created a new datagrid.
Now the grid displays on my web form filled with sample data, which is
something it was not doing before. I also noticed that it allows me to use
the property page for the datagrid to select the DataSource and DataMember
properties in the dropdown list fashion, another thing it was not doing
before.

But i'm still having the same problem. It displays the Datagrid headings
but not the data from the typed dataset. I also tried assigning the
datasource and datamemeber dynamically.

Do you have any other ideas of what to try ?

Thanks,
Tony

"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
news:...
> Brian.
>
> Yes. I just checked it again. Very strange. When i use this statement:
> Me.tripsDataGrid.DataSource = Me.tripsDataSet
>
> It display the empty grid with the column name across the top.
>
> If i use this statement:
> Me.tripsDataGrid.DataSource = Me.tripsDataSet.DataSetName
>
> It displays the grid with one column named "Item" and puts the name of the
> dataset under it one letter at a time like this:
> t
> r
> i
> p
> s
> D
> S
>
> Thanks,
> Tony
>
> "Brian Foree" <> wrote in message
> news:...
>> Are you loading the data into the table before you call the DataGrid's
>> DataBind method? I know you said that the data is in the tripsTable rows
>> because you can display them in the debugger, but did you check that just
>> before the DataBind call?
>>
>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>> news:...
>>> Hello Brian.
>>>
>>> I tried all of your suggestions and nothing worked. However, i did
>>> notice that the line "Me.tripsDataSet.tripsTable.TableName" does yield
>>> the correct table name, so i will probably stay with that in my coding.
>>>
>>> All i need to do now is figure out why the grid is empty.
>>>
>>> Thanks,
>>> Tony
>>>
>>> "Brian Foree" <> wrote in message
>>> news:...
>>>>I don't know if this would make a difference, but everything looks OK in
>>>>your code with the possible exception of the following line:
>>>>
>>>> Me.tripsDataGrid.DataMember = Me.tripsDataSet.tripsTable.ToString
>>>>
>>>> I'd suggest replacing the right side of the expression with the name of
>>>> the table as a String, like so (I'm guessing at the name of the table
>>>> within your DataSet):
>>>>
>>>> Me.tripsDataGrid.DataMember = "trips"
>>>>
>>>> The reason I'm suggesting this is because I seem to remember a similar
>>>> problem that was related to the DataMember being set incorrectly.
>>>>
>>>> You could also set a breakpoint on this line (without the
>>>> modification), run the app in Debug mode and see what
>>>> "Me.tripsDataSet.tripsTable.ToString" evaluates to at that point. I did
>>>> notice that the ToString method of a System.Data.DataTable returns "the
>>>> TableName and DisplayExpression, if there is one as a concatenated
>>>> string", so one possibility is that there is a DisplayExpression, which
>>>> would cause problems when you assign the DataMember.
>>>>
>>>> If my suggestion works and you still want to assign the DataMember
>>>> dynamically, you could try Me.tripsDataSet.tripsTable.TableName, which
>>>> contains just the name of the table as a String.
>>>>
>>>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>>>> news:...
>>>>> Hello.
>>>>>
>>>>> I'm developing and testing a web application using VS.NET 2003, VB,
>>>>> .NET
>>>>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
>>>>> computer. I'm using a web form.
>>>>>
>>>>> I'm trying to display a datagrid on my web form using this code:
>>>>> Me.tripsDataGrid.DataSource = Me.tripsDataSet
>>>>> Me.tripsDataGrid.DataMember =
>>>>> Me.tripsDataSet.tripsTable.ToString
>>>>> Me.tripsDataGrid.DataBind()
>>>>>
>>>>> It displays the DataGrid on the form with the column headers but no
>>>>> data rows. The data is in the tripsTable rows because i can display
>>>>> them in the debugger.
>>>>>
>>>>> How do i debug this to figure out why it is not populating the
>>>>> datagrid ?
>>>>>
>>>>> Any help would be gratefully appreciated.
>>>>>
>>>>> Thanks,
>>>>> Tony
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
debug="false" in web.config and <%@ debug="true" ...%> in aspx file => true or false? André ASP .Net 3 08-28-2006 12:02 PM
Config Mgr Debug/Release and Web.config Compilation debug=true RonL ASP .Net 0 04-08-2006 03:50 PM
Debug (DLL MFC) -> Debug (Static MFC) ringos75 C++ 0 04-14-2005 01:50 PM
[Howto] Compiling debug Python extensions for non-debug Python Mike C. Fletcher Python 3 10-12-2003 09:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57