C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to create a back end connection


Posted Date: 07 Sep 2008      Total Responses: 3

Posted By: ravikumar       Member Level: Bronze     Points: 1



hello friends

how could u please tell me that how to create a back end connection to the project.

cheer's
ravi





Responses

Author: D.Jeya kumar(JK)    07 Sep 2008Member Level: DiamondRating:     Points: 6

Hi,


Using the Sqlclient or OLEDB



System.Data.SqlClient.SqlConnection
sc =
new System.Data.SqlClient.SqlConnection(@"Data Source=sourcename;Initial Catalog=Dbname;"+
"Integrated Security=True")
{
sc.Open();
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand()
{
com.CommandType = CommandType.Text;
com.Connection = sc;

string SQLStatement = "SELECT * FROM ExampleTable";

SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQLStatement,sc);

DataTable dtResult = new DataTable();

SQLDataAdapter.Fill(dtResult);


}
}



Regards
JK



Author: AbidiP    08 Sep 2008Member Level: GoldRating:     Points: 1

www.connectionstrings.com


Author: ramya    08 Sep 2008Member Level: GoldRating:     Points: 3

using system.data.sqlclient;

in button_click ()
{
sqlconnection cn=new sqlconnection("user id=sa;database=master;server=.');
cn.open();
messagebox.show("connected to backend");

}



Post Reply
You must Sign In to post a response.
Next : books queries
Previous : Difference
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use