Wrox Programmer Forums
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2003, 04:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default Dataset

Dear Friends, (I'm back again:D)
Im useing C# With SQL Server as usual!
I fill my dataset with DataAdapter & ... but there is Problem!!
I mean its something disconnected (When a record updated or inderted its dosnt effect)

Its my first experiance with Dataset in C#, so Please tell me what should I do?! witch u help me much!!!

Always,:)
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
 
Old June 29th, 2003, 05:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

http://msdn.microsoft.com/library/de...terdataset.asp
 
Old June 29th, 2003, 06:47 AM
Authorized User
 
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Firstly I presumed you are using SQLDataAdapter.
Secondly, is your connection string is correct and user & logon permission is valid, for example you may have restriction on read & write permssion.
Thirdly, you may already used your SqlDataAdater object and it is still remaining open, if trying to connect any different databases connection will be met with a problem.

This sample should work (assumed connection & logon permission is valid)
DataSet myDS=New DataSet("MyDataSet")
string cnn = data source=yourserver;user id=yourlogin;password=yourpwd;initial catalog=yourdatabase"
string sqlCmd ="SELECT * FROM TABLE1"
SqlDataAdapter myDA=new SqlDataAdapter(sqlCmd,cnn)
myDA.Fill(myDS)

This should fill your dataset, when you construct the SqlDataAdater, it should also opens the connection, if not use myDA.SelectCommand.Connectioin.Open() after constructing your adapter object.
This should auto create your table in your dataset (myDS).
Hope this help.

Cheers
Kasie





Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill a DataSet from another DataSet kamranzafar C# 1 February 7th, 2007 11:14 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Copy dataset to another dataset kapila VB.NET 2 November 13th, 2005 06:25 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.