任何人都可以帮助解决这个问题 [英] Any body please help about this question
本文介绍了任何人都可以帮助解决这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我可以将值插入数据库,那么我将获得.net应用程序.
我怎么能得到这个...
在此先感谢
If i can insert values into database then i will get .net application.
how can i get this...
Thanks in advance
推荐答案
我想您需要通过C#将值插入数据库中.
始终以msdn开头- http://msdn.microsoft.com/zh-CN -us/library/ms233812%28v = vs.80%29.aspx [
I suppose you require to insert values into a database via C#.
Always start with msdn - http://msdn.microsoft.com/en-us/library/ms233812%28v=vs.80%29.aspx[^].
这是用于插入:
要进行检索,您需要付出一些努力尝试自己找出答案
This is for insert :
For retrieving You need to put some Effort try to find out by yourself
SqlConnection Con;
SqlCommand Cmd;
SqlDataReader dr;
public string fn_insertCategoryDetails(string strCategoryName)
{
try
{
Con = new SqlConnection(ConfigurationManager.ConnectionStrings["yoConnectionString"].ConnectionString);
Con.Open();
Cmd = new SqlCommand("INSERT INTO InterviewCategories(Category)Values(@name)", Con);
Cmd.Parameters.AddWithValue("@name", strCategoryName);
if (Cmd.ExecuteNonQuery() > 0)
{
return "SUCCESS : Record has been inserted";
}
else
{
return "ERROR : SQL Exception";
}
}
catch (Exception ex)
{
return "ERROR : " + ex.Message;
}
finally
{
if (Con != null)
{
Con.Close();
}
}
}
阅读此链接[ ^ ]
Read This Link [^]
这篇关于任何人都可以帮助解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文