Dynamic and complex query(C#+sql server2000)

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Dear Friends,

How do write the below dynamic update Query? I am new to this SQL Query.Its
very very urgent requirements.
If anyone knows please help me the below SQL query.
I would appreciate any help.

UpdateEmployee()

FieldName datatYpe

EmpName - string
EmpNo - int
Sex - string
Salary - Float
DoB - datetime
Address - string
Remarks - string
hours - int
AvailableDate -dtatetime

Passed Parameters: EmpNo or EmpName, sex, Salary, DOB, Address,
Remarks,hours, AvailableDate

Please note, this method is overloaded. Although either the EmpNo or
EmpName is required in order to select the Employee record, one or more of
the other variables may be passed.

Return Parameters: ErrorCode

Pseudo Code:

1. Confirm that either the EmpNo or the EmpName exists in the database

2. Confirm that at least one other parameter is passed

3. Confirm that all passed parameters are of the correct data type

4. Update the Employee Table using the Passed Parameters to modify the
fields


Thanks,
 
When you drop an oledbdataadapter on a form, the designer will create
connection object and generate update, delete, insert and select statements
for you. Then switch to code view and expand initializecomponents() method.
You'll see what your looking for in there.

Also, make sure you have an ODBC connection setup for target database
because designer will ask for it.

Charlie
 
Back
Top