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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 6, 2014, 6:01 PM EST
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.
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Mar 6, 2014, 9:35 PM EST
Praveen Jeyarajah3 reputationPosted Mar 7, 2014, 2:48 AM EST
send me select,update,insert, delete coding for C#
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 9, 2014, 7:56 PM EDT
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.
caron judith2 reputationPosted Oct 5, 2014, 10:18 PM EDT
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