What is CrazyEngico.com (CE)?

CrazyEngico (CE) is a one-stop solution for interview questions and answers, domain knowledge, e-learning, tutorials, articles and many more learning material.
e-learning - Intelligent e-learning tutorials and articles
Domain Knowledge Learn about various business domains/verticals such as Banking, Financial, Insurance, Healthcare and many more...
Interview Questions and Answers - Post your questions and answers. 1000+ database of ready questions and answers available to prepare for an interview.
Tutorials - 300+ video tutorials from beginner to expert level.
Articles - 300+ technical articles to understand concepts.
Forum - A technical forum to post your queries/responses.

Search Questions

Interview Questions/Answers

Ads
Question
Interview Q & A >> ADO.NET >> How would you connect to database using .NET?

<< Previous Question Navigator Next >>

2        0
How would you connect to database using .NET? (Views: 2332)


Answers

2        0

SqlConnection nwindConn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI; Initial Catalog=northwind");
nwindConn.Open();

Submitted By: Anonymous | Created On: 5/16/2009 4:19:02 PM


0        0

sqlconnection con = new sqlconnection(Data source="";integrated security = "SSPI";); con.open; string cmd = select * from table_name; sqlcommand cmd = new sqlcommand(string,con); sqldataadapter da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds); con.close(); that is all with the logic !!

Submitted By: Anonymous | Created On: 7/15/2009 8:13:13 AM

0        0

sqlconnection con = new sqlconnection(Data source="";integrated security = "SSPI";); con.open; string cmd = select * from table_name; sqlcommand cmd = new sqlcommand(string,con); sqldataadapter da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds); con.close(); that is all with the logic !!

Submitted By: Abhijeet V | Created On: 7/15/2009 8:13:57 AM

0        0

Sql connection con=new sqlconnection("Data Source=localhost; Initial catalog=database name;iIntegrated Security=true");
con.open();

Submitted By: Anasuya | Created On: 12/6/2012 11:00:02 AM


Post your Answer
Your answer will be first reviewed by our administrator before it appears on the site.

Your Answer:


 
Display Name:





By clicking on Submit button you agree to the Terms of Service agreement.




Copyright © 2018 CrazyEngico.com. All rights reserved.
CrazyEngico.com is not responsible for the content and CrazyEngico.com does not evaluate or guarantee the accuracy of any CrazyEngico.com content.
Please read our terms of service agreement before using this site.

feedback