Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried each and every operation using SQL Database but now I was asked to do in Typed dataset.

I am convenient in database but I don't know how to link normal dataset to typed dataset.

Can any one help me to get rid of this problem.

C#
 if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }

                cmd = new SqlCommand("SP_NewRecord", con);

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Clear();
                //cmd.Parameters.Add("Id", SqlDbType.BigInt).Value = Id;
                cmd.Parameters.Add("Name", SqlDbType.VarChar).Value = Name;
                cmd.Parameters.Add("DOB", SqlDbType.DateTime).Value = DOB;
                cmd.Parameters.Add("Designation", SqlDbType.VarChar).Value = Designation;
                cmd.Parameters.Add("Mobile", SqlDbType.BigInt).Value = Mobile;
                cmd.Parameters.Add("MailId", SqlDbType.VarChar).Value = MailId;
                cmd.Parameters.Add("Salary", SqlDbType.Decimal).Value = Salary;

                //cmd = new SqlCommand("insert into EmployeeDetails values(5,'RR','1991-04-20','Junior','7897897898','kk@gmail.com',24000)",con);
                cmd.ExecuteNonQuery();


con.Close();
Posted

 
Share this answer
 
Comments
KUMAR619 27-Jun-14 8:09am    
I have created a typed dataset then I have created a adapter and loaded all queries then how to use in C#
Pravuprasad 27-Jun-14 8:27am    
Refer the 2nd link. You can get idea about that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900