如何在C#中使用Typed Dataset [英] How to use Typed Dataset in C#
本文介绍了如何在C#中使用Typed Dataset的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了使用SQL数据库的每一项操作,但现在我被要求在Typed数据集中进行操作。
我在数据库方便,但我不知道如何将普通数据集链接到类型化数据集。
任何人都可以帮我摆脱这个问题。
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.
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();
推荐答案
Hi
参考此链接
http://www.c-sharpcorner.com/UploadFile/rupadhyaya/TypedDataSets12032005021013AM/TypedDataSets.aspx [ ^ ]
你可以通过以下链接。
http://stackoverflow.com/questions/8197057/how-to-use-typed-datasets-in-c [ ^ ]
http://support.microsoft.co m / kb / 320714 [ ^ ]
http://www.c-sharpcorner .com / UploadFile / rupadhyaya / TypedDataSets12032005021013AM / TypedDataSets.aspx [ ^ ]
you can go through below links .
http://stackoverflow.com/questions/8197057/how-to-use-typed-datasets-in-c[^]
http://support.microsoft.com/kb/320714[^]
http://www.c-sharpcorner.com/UploadFile/rupadhyaya/TypedDataSets12032005021013AM/TypedDataSets.aspx[^]
这篇关于如何在C#中使用Typed Dataset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文