INTERVIEW QUESTIONS
MICROSOFT
ADO.NET
DETAILS
Question: How can we load multiple tables in to Dataset?
Answer: We can do this by using DataAdapter's fill Method.Syntax for This is
DataSet ds=new DataSet();
SqlDataAdapter dap=new SqlDataAdapter(<query1>,<connection>);
dap.Fill(ds,"<TableName>");
SqlDataAdapter dap1=new SqlDataAdapter(<query2>,<connection>);
dap1.Fill(ds,"<TableName1>");
|
Question:
How can we load multiple tables in to Dataset?
Answer:
We can do this by using DataAdapter's fill Method.Syntax for This is
DataSet ds=new DataSet();
SqlDataAdapter dap=new SqlDataAdapter(<query1>,<connection>);
dap.Fill(ds,"<TableName>");
SqlDataAdapter dap1=new SqlDataAdapter(<query2>,<connection>);
dap1.Fill(ds,"<TableName1>"); Source: CoolInterview.com
we can load multiple table ina single dataset by this code SqlDataAdapter dap=new SqlDataAdapter(<query1>,<connection>); DataSet ds=new DataSet(); dap.fill(ds,"<tablename1>"); dap.fill(ds,"<tablename2>"); Source: CoolInterview.com
Answered by: rahilmohd | Date: 4/6/2009
| Contact rahilmohd
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|