N
nashak
Hello,
I am trying to build a database project and have the following.
I have one table "Subject" in sql server.
I have a dataclass Data1
I have a business class Business1
I have a connection class Connection1 that instantiates and returns a
new sqlconnection object
Business1 calls connection class and gets a new connection.
Now Business1 instantiates Data1 object. New() creates a new
dataadapter, 4 sqlcommand objects and assigns them to the
dataadapter.command and creates a dataset object
Now Business1 calls GetEmptyRecord() of Data1 and passes name of a
table and connection object
In GER() I assign a sql to commandtext, set commandtype and connection,
create new table, add to dataset, fills dataset using fillschema,
create emptyrow in table. Now I pass this datarow to Business1.
Is there any way in which I can find the column names of the columns in
this datarow. Since i filled table with fillschema it should have the
column names and I want to avoid hard-coding column names in my code.
Also, is there a way to automatically generate update, delete and
insert sql commands? I tried using commandbuilder but that is not
working.
Thanks,
I am trying to build a database project and have the following.
I have one table "Subject" in sql server.
I have a dataclass Data1
I have a business class Business1
I have a connection class Connection1 that instantiates and returns a
new sqlconnection object
Business1 calls connection class and gets a new connection.
Now Business1 instantiates Data1 object. New() creates a new
dataadapter, 4 sqlcommand objects and assigns them to the
dataadapter.command and creates a dataset object
Now Business1 calls GetEmptyRecord() of Data1 and passes name of a
table and connection object
In GER() I assign a sql to commandtext, set commandtype and connection,
create new table, add to dataset, fills dataset using fillschema,
create emptyrow in table. Now I pass this datarow to Business1.
Is there any way in which I can find the column names of the columns in
this datarow. Since i filled table with fillschema it should have the
column names and I want to avoid hard-coding column names in my code.
Also, is there a way to automatically generate update, delete and
insert sql commands? I tried using commandbuilder but that is not
working.
Thanks,