Please send me the coding for connecting sql server database
please send me the coding for connecting sql server with C#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
caron judithPosted Oct 6, 2014, 2:18 AM
connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! ");
}
Full Source....
http://csharp.net-informations.com/data-providers/csharp-sql-server-connection.htm
Caron
Jignesh TrivediPosted Mar 9, 2014, 11:56 PM
hi,
Please refer
http://androidsharp.blogspot.in/2013/07/createreadupdatedelete-crud-operations.html
http://www.novicksoftware.com/Articles/crud-operations-using-sql-server-stored-procedures-part-1.htm
http://www.dotnetspark.com/kb/667-crud-operations-using-linq-entities.aspx
hope this will help.
Praveen JeyarajahPosted Mar 7, 2014, 7:48 AM
send me select,update,insert, delete coding for C#
Lakshmanan Sethu SankaranarayanPosted Mar 7, 2014, 2:35 AM
Jignesh TrivediPosted Mar 6, 2014, 11:01 PM
hi,
try
string connetionString="Data Source=ServerName; Initial Catalog=DatabaseName;User ID=UserName;Password=Password";
var con = new SqlConnection(connetionString);
con.Open();
// do your code
Con.Close();
Also refer
http://www.codeproject.com/Articles/4416/Beginners-guide-to-accessing-SQL-Server-through-C
http://www.daniweb.com/software-development/csharp/threads/339949/how-to-establish-a-connection-with-sql-server-using-c
hope this will help you.