student Posted April 26, 2004 Posted April 26, 2004 Hi, I have customer register form (with ssn,fname,lname,address,apt,city,state,zip,custid) which will store datas in 4 different tables. I am trying to create more controls like Add,Update,Delete. For updating ,i am getting their custid as input and i need to update all tables by using custid. I know that for updating we need to use this command, "Update table customer set name ="fsgf" where custid = ' &idtext.text &'" But i need to update morethan 8-9 columns(ssn,fname...).Do i need to do this update query 9 times or is there anyother way for this? thanks Quote
Moderators Robby Posted April 26, 2004 Moderators Posted April 26, 2004 Are you using Sql Server, or any DB that facilitates Stored Procs? If so, I would do the entire update, insert or delete within a stored proc. Quote Visit...Bassic Software
iebidan Posted April 26, 2004 Posted April 26, 2004 to update several columns in a single table you can use this: UPDATE TABLE1 SET COLUMN1 = 'string value', COLUMN2 = 12345, COLUMN3 = 'string value', COLUMN4 = 'string value' WHERE COLUMN5 = 12345 if you're updating several tables at the same time with the same information the best approach will be to use a Stored Procedure (if you have SQL Server or any database that support SP's) otherwise, create the UPDATE queries you need for the tables you need to update Quote Fat kids are harder to kidnap
student Posted April 27, 2004 Author Posted April 27, 2004 thanks Hi, Thanks for the reply. It worked fine for me. Do u know how to pass arguments from one form to another form? I want to pass the variable value from one form to another form. Thanks Quote
Administrators PlausiblyDamp Posted April 27, 2004 Administrators Posted April 27, 2004 Not sure if you want a web or windows answer so pick one of the following windows forms or ASP.Net Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Keroleen Posted April 30, 2004 Posted April 30, 2004 For update is it not possible to use this: dap1.Update(das1, "table") I am using a datagrid. I am able to fill my datagrid. I would like to enter information into the datagrid and for it to be entered into the database. Enter information in the cell and press and 'update' button which has the above code in it. But I cant get it to work as i get this error: An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll Additional information: Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.