PC Review


Reply
Thread Tools Rate Thread

datagrid with typed dataset returns nulls

 
 
Patrick Sullivan
Guest
Posts: n/a
 
      11th Aug 2005
Hi all, I odered a book on VB.Net (ADO Net core reference) but haven't
recieved it yet. And I have found lots of info on datagrids and have used
them lots before. But now using a typed dataset, I cannot get a view table
in the typed dataset to load into the grid. No errors, just no records.
"Applications" is the typed dataset, and it contains one view named
"vwApplications" that works in SQL server, and I can get it to work using
regular untyped datasets in ADO.Net. What do I need to do in typed datasets
to use it? BTW, it just displays a row of nulls, and it should have data.
There's no null data in the tables or view.

' create instance of the typed dataset

tds = New Applications

' command object to pull data for datasets

Dim cmd As New SqlCommand("SELECT * FROM vwApplications", con)

' Use the sqldataadapter to fill datasets

Dim da As SqlDataAdapter = New SqlDataAdapter

' Select command for Typed Dataset

da.SelectCommand = cmd

' Fill Dataset

da.Fill(tds)

dgApps.SetDataBinding(tds, "vwApplications")

con.Close()

-- TIA

Patrick Sullivan, AA-BA, BA-IT


 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      11th Aug 2005
Patrick,

Most people use the datasource to bind a table to a datagrid (or any other
"data" control)

http://msdn.microsoft.com/library/de...ourcetopic.asp

You know that we have a website with all kind of VBNet windowforms datagrid
tips (sample code).
(However, as well not really based on the typed dataset)

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor




 
Reply With Quote
 
Patrick Sullivan
Guest
Posts: n/a
 
      11th Aug 2005
Thanks, Cor, I will check out the urls in a minute. But I want to display
stringA, stringB, stringC, stringD in the grid from related tables, in one
row, not with the !~@!@# +- child row controls. All the main table has is a
few data fields, the rest are foreign keys. That is why I am using a view.

SELECT TOP 1000 dbo.Positions.posName AS [Position],
dbo.Companies.compName AS Company, dbo.Applications.app Date AS [Date],
dbo.Applications.appNotes AS Notes,
dbo.Applications.appID AS ID, dbo.Companies.compID, dbo.Positions.posID
FROM dbo.Companies INNER JOIN
dbo.Applications ON dbo.Companies.compID =
dbo.Applications.appCompany INNER JOIN
dbo.Positions ON dbo.Applications.appPosition =
dbo.Positions.posID
ORDER BY ID

I was wanting to use a typed dataset as well, since I have found that using
untyped might work for a while, but when you modify something, add features,
etc, you tend to get more errors, often with the data types, that's why I
wanna use typed datasets to begin with.
Thanks!

--

Patrick Sullivan, AA-BA, BA-IT

"Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Patrick,
>
> Most people use the datasource to bind a table to a datagrid (or any other
> "data" control)
>
>

http://msdn.microsoft.com/library/de...ourcetopic.asp
>
> You know that we have a website with all kind of VBNet windowforms

datagrid
> tips (sample code).
> (However, as well not really based on the typed dataset)
>
> http://www.windowsformsdatagridhelp.com/default.aspx
>
> I hope this helps,
>
> Cor
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
typed dataset and datagrid DougS Microsoft ASP .NET 0 7th Jan 2006 07:09 PM
Simple Question - Datagrid and Typed dataset Saber Microsoft VB .NET 13 18th Aug 2005 12:50 PM
Strongly Typed Dataset Table - Indexed Find returns Nothing David Wender Microsoft ADO .NET 2 17th Aug 2004 12:16 AM
Problem filling Strongly Typed DataSet from an Oracle 9i stored procedure that returns multiple ref cursors DotNetGruven Microsoft ADO .NET 2 21st Jul 2004 04:12 AM
GetChanges in a Typed Dataset returns a DataSet?? Paddy Microsoft ADO .NET 1 5th Jul 2003 05:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:41 AM.