N
Neo
I konw that one can make use of the default UpdateCommand in the DataAdapter
to save changes back into the underlying data source.
But i was wondering how one could build a custom update command & set this
into the DataAdapter & when the Update method of the Data Adapter is issued,
then this update command should be used.
Esp, if the table is Customer with the following fields,
ID = Primary Key Field (Integer)
Name = Varchar
Male = Bit
UpdateCmd = "UPDATE Contacts SET Name=@Name, Male=@Male WHERE ID=@ID"
But to do this, i need to add the parameters into the update command of the
format,
UpDataCmd.Parameters.Add("@Name", <Column Data Type>, <Column Size>, "Name")
UpDataCmd.Parameters.Add("@Male", <Column Data Type>, <Column Size>, "Male")
UpDataCmd.Parameters.Add("@ID", <Column Data Type>, <Column Size>, "ID")
Now, is there a way i could determine the above,
the Data Type of the columns (SQL Data type) & the Size of the fields (in
the SQL Table).
I don't mind querying the data base to get this info).
Thanx,
Neo
to save changes back into the underlying data source.
But i was wondering how one could build a custom update command & set this
into the DataAdapter & when the Update method of the Data Adapter is issued,
then this update command should be used.
Esp, if the table is Customer with the following fields,
ID = Primary Key Field (Integer)
Name = Varchar
Male = Bit
UpdateCmd = "UPDATE Contacts SET Name=@Name, Male=@Male WHERE ID=@ID"
But to do this, i need to add the parameters into the update command of the
format,
UpDataCmd.Parameters.Add("@Name", <Column Data Type>, <Column Size>, "Name")
UpDataCmd.Parameters.Add("@Male", <Column Data Type>, <Column Size>, "Male")
UpDataCmd.Parameters.Add("@ID", <Column Data Type>, <Column Size>, "ID")
Now, is there a way i could determine the above,
the Data Type of the columns (SQL Data type) & the Size of the fields (in
the SQL Table).
I don't mind querying the data base to get this info).
Thanx,
Neo