473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting an emty dataset

What is the best way to get an empty datatable (or data row) that is
formatted like a row in my sql table, I assume that doing a select * from
table where 1 = 0 is not a very efficient way to do it? Do I some how
define the table structure as an object which would needs to be updated if a
column was added to the database? What I need to be able to do is reference
the columns in my datarow, by the name that they are called in the database.
Thanks
Aug 21 '06 #1
1 837
David,

You can use the dataadapter's FillSchema method.

Kerry Moorman
"David A. Osborn" wrote:
What is the best way to get an empty datatable (or data row) that is
formatted like a row in my sql table, I assume that doing a select * from
table where 1 = 0 is not a very efficient way to do it? Do I some how
define the table structure as an object which would needs to be updated if a
column was added to the database? What I need to be able to do is reference
the columns in my datarow, by the name that they are called in the database.
Thanks
Aug 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oleg Shnayderman | last post by:
Hi All, I am very new to C# as well as to SQL. I need to write an application which is connecting to SQL DB and getting all the user's tables and after create a dataset for all the tables in the...
6
by: Erik H. | last post by:
Trying to connect to MySQL db on localhost, and populate datagrid from a dataset using code inline method. Getting the following compile error: Error Message: "CS0246: The type or namespace...
4
by: What-a-Tool | last post by:
I am trying to write a program that will take all the members of a data base, add them to a tree, with all child relations as sub-nodes. I am having a problem getting the parent child relations...
3
by: vineetaghag | last post by:
why the size of emty struct is 1 byte in C/C++ ?
0
by: mike1402 | last post by:
Hi ! I get the error below sometimes when retrieving a big amount of data using Datadapter.Fill(dataset,"table"). But when I send the command Fill again, there is no error. Is it a fault of...
2
by: Claes Wedin | last post by:
My customer needs a DateTimePicker in VS2005 C# that can show emty date values (blank/space/null). I need a control that: 1. Can show a blank value 2. Detete a date when hitting the delete...
4
by: nch1978 | last post by:
I am new to programming and am sorry if this post is in the wrong area. I have a listbox bound to a table and a datagrid bound to another one with a connection through xml. I can change the data...
3
by: H | last post by:
I have a dataset with Customers, Orders, and Items tables. It has datarelations set between Customers-Orders and Orders-Items It has foreignkeyconstraints with update/delete rules set to cascade...
4
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Why am I getting an error when I passed by ref a dataset to a new form? The message reads "cannot convert from 'ref Paimport.unixAccount' to 'ref System.Data.DataSet'. Paimport is the name of the...
2
by: rocketfire97 | last post by:
I'm trying to call a COM object using C# but having no luck getting values back for passed in ref objects. I've tried the same call using VB.NET and can get data back. How would I implement the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.