473,386 Members | 1,673 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,386 software developers and data experts.

DataSet, SqlDataAdaptor.Fill?

Hi,

I have the following situation:
Two tables with relation:

T1:
Id_T1:Primary key
Data1_T1
Data2_T2
Id_T2:Secondary key

T2:
Id_T2:primary key
Data1_T2

I've created typed DataSet, which includes both tables and the relation
between them.

And now the question: I want to fill this dataset using SqlDataAdaptor
with select command which is Store procedure on the server. Is this
possible and how could I do it? Or I have to use Visual Studio wizards
to generate SqlDataAdaptor and the select statement? I prefer first (if
it is possible)?

Thanks.

Nov 17 '05 #1
1 1881
Hi,
Create SqlAdapterclass giving SqlCommand as input. This SqlCommand
object will have CommandText property set to storedProcedure name and
CommandType property set to CommandType.StoredProcedure.

Then use SqlAdapter's Fill method to load dataset.

Hope this helps.

Reshma
"Iwan Petrow" <xx****@abv.bg> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hi,

I have the following situation:
Two tables with relation:

T1:
Id_T1:Primary key
Data1_T1
Data2_T2
Id_T2:Secondary key

T2:
Id_T2:primary key
Data1_T2

I've created typed DataSet, which includes both tables and the relation
between them.

And now the question: I want to fill this dataset using SqlDataAdaptor
with select command which is Store procedure on the server. Is this
possible and how could I do it? Or I have to use Visual Studio wizards
to generate SqlDataAdaptor and the select statement? I prefer first (if
it is possible)?

Thanks.

Nov 17 '05 #2

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

Similar topics

2
by: Vaap | last post by:
I am trying to get dataset working through IDbDataAdapter interface as my solution need to work with Sql Server and Oracle ODP. I am using different data provider factories and the code here only...
1
by: epro | last post by:
I have a dataset of one table. and I want to save that dataset onto a database table. I tried SqlDataAdaptor, but i dont want to write the sql. Any help is appreciated. Prasanna
4
by: Joerg M. Colberg | last post by:
Hi all, I have a problem when using a DataSet. I am using it to query a SQLServer database as follows. In my code it looks like SqlDataAdapter eDA = new SqlDataAdapter(sqlcmd); // where...
1
by: xxxxyz | last post by:
Hi, I want to generate dataset class using Visual studio ( I can do this as first generate SqlDataAdaptor and SqlConnection). But can I ganerate it without sqldataadaptor and sqlconnection,...
12
by: Bishoy George | last post by:
I have a dataset called ds1 filled with 2 tables Employees and Customers from Northwind database. I have dropdownList called ddLastName with the following properties: ddLastName.DataSource =...
2
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
11
by: Elena | last post by:
I am trying to get a number from the last row in a table. When I get to the line of code to get the count, I get an error: An Unhandled exception of type 'System.IndexOutOfRangeException'...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
0
by: =?Utf-8?B?TXlMYWJSdWJ5?= | last post by:
I am developing an application that will be able to be used offline from the SQL server and am trying to come up with a good way to do this. My thought at this moment is to basically work "offline"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.