Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 
Dataset Tablenames <- SQLHelper (Thursday, January 26, 2006)

 

Found the following interesting discussion in the Newsgroups:

Dataset Tablenames <- SQLHelper
by:Lucas Tam

I'm not sure if this is a problem with Microsoft's Application Data Blocks,
but I am using a query like this:

USE DATABASENAME;SELECT * FROM SOMETABLE

The tablename property of my datasets are not being set - this causes a
problem with CrystalReports.

Is there a way to auto-set the Tablename in a dataset?

Thanks.

--
Lucas Tam


 Reply:
by:Josh Golden

 use FillDataset instead of ExecuteDataset. here's the signature on one of
them. as you can see, the tableNames() array is for this.

Public Overloads Shared Sub FillDataset(connectionString As String,
commandType As CommandType, commandText As String, dataSet As DataSet,
tableNames() As String)


 Reply:
by:Lucas Tam

 
Shoot, I was hoping there was some automatic way to pick up the table names
from the database. I'm using System.Reflection to dynamically instantiate
my functions, so any manual work is a bit hard to do.

Anyhow, thanks for your help!

--
Lucas Tam



Posted by Xander Zelders



0 Comments:

Post a Comment

<< Home

 
Previous Posts
    - Datagrid (windows forms)
    - Inheritance problem with custom control
    - Master details grid remove the cross
    - Unicode/international
    - SQLDMO error in .NET
    - Can't write to the event log
    - Communication
    - Crystal report
    - api call using struct*
    - Custom message loop



Disclaimer & Terms of Use | DotNet4All.Com concept & © 2004 - 2007 by Zelders² - Holland