473,386 Members | 1,630 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.

SqlDataAdapter Problem

Hi,

Here is a short decsription of my problem.

I have written a dll for Database accessing. I have one method which can
return a Dataset and another method which takes a Dataset and upates a
Database. (Disconnected Datasets).
The problem I have is a new SqlAdapter is required before updating the
Database:
Therefore, to allow the update I have to do the following:

m_DataAdaptor = new SqlAdapter("select * from club",m_Conn);

I want a generic method for updating, but this way means I have to put a
hardcoded SQL string as the first parameter. The connection object is a
class member and the DataSet is passed in from the client.

Basically, what I want is a method that takes a Dataset as a parameter and
can update a Database.

One idea I had was to make the SqlDataAdapter a method of the DB class. This
means the SqlDataAdapter would stay in scope during the life of the object
(DB class).

Is there some other method of updating a Database using a Dataset ?

Any help / suggestions would be appreciated

Regards,

Steven
www.stevenblair.com

Steven
www.stevenblair.com
Nov 16 '05 #1
0 908

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

Similar topics

7
by: Programatix | last post by:
Hi, I'm working on a WebService project. I'm trying to validate data before they are updated to the database by handling the RowUpdating event for a SqlDataAdapter. The data being handled has...
1
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a...
6
by: goodstart123 | last post by:
For example, the following code works fine without SqlConnection. Any Answer to the question? string connectionString = "server=YourServer; uid=sa; pwd=YourPassword;...
2
by: Sgt. Sausage | last post by:
New to multi-threading (less than 24 hours at it <grin>) Anyway, it's all making sense, and working fairly well thus far, but I'm having a minor issue I'm not sure how to get around. I've got...
10
by: Victor | last post by:
Hello there, I have a module in VB.NET (ASP.NET) and on top I declare the SqlConnection and the SqlDataAdapter. Like: Module AccessDB Dim sqlCmd As New SqlCommand Dim conAanvraag As New
7
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise...
4
by: HS1 | last post by:
Hello. I declare a SqlDataAdapter in a FormLoad as below. However, there is error claimed that the SqlDataAdapter is not defined. Could you please tell me what to do ------------------ ...
1
by: archana | last post by:
Hi all I ma having problem in sqldataadapter. In my sql database i have one table containing column name as 'Name and address'. Here 'and' is reserved word which i am using in column name. In...
1
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The...
3
by: Spectre1337 | last post by:
Hello, I've encountered a rather puzzling problem with SqlDataAdapter. I've set up a number of elaborate tables in the Microsoft SQL Server Management Studio Express (including several table key...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.