how to connect database connectivity in dotNET? if suppose
SQL server?and also MS access?
Answers were Sorted based on User's Feedback
Answer / aravind
in code behind give namespace
using System.data.sqlclient;
and write connections string in web.config to which
database to connect
| Is This Answer Correct ? | 40 Yes | 6 No |
Answer / guest
in web.config file
<configuration>
<appSettings>
<add key="SqlCon" value="Data
Source=winserver;initial
Catalog=cieflnew;uid=cieflnew;pwd=cieflnew; Connection
Lifetime=0;Max Pool Size=10000;Min Pool Size=0;Connection
Reset=false;Pooling=true;Persist Security Info=False"/>
</appSettings>
<system.web>
and in code behind
Sql cmd= new Sql command(Query here,con);
cmd.executenonquery();
| Is This Answer Correct ? | 23 Yes | 7 No |
Answer / rajesh chekuri
MySQLConnection myConn;
myConn = new MySQLConnection(new
MySQLConnectionString("localhost", "databse", "User",
"password").AsString);
For More Info Visit www.funnydotnet.co.cc
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / raju
SQl Server
namespace->Using System .data.Sqlclient;
SqlConnectin con=new SqlConnection
("Servername="";uid="";pwd="";database="")
Ms-Access:
Namespace->using system.data.oledb;
oledbconnection con=new oledb connection
("Servername="";uid="";pwd="";database="")
| Is This Answer Correct ? | 12 Yes | 4 No |
Answer / manish
in the sql server
using system.data.sqlclient
sqlconnection con=new
sqlconnection("server=;uid=;pwd=;database=;");
con.open();
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / konda
USe system.data.oledb for connect int both sql and Ms
access and Oracle also
| Is This Answer Correct ? | 5 Yes | 4 No |
Answer / varun
in the sql server
using system.data.sqlclient
sqlconnection con=new
sqlconnection("server=;uid=;pwd=;database=;");
con.open();
Ms-Access:
Namespace->using system.data.oledb;
oledbconnection con=new oledb connection
("Servername="";uid="";pwd="";database="")
| Is This Answer Correct ? | 3 Yes | 2 No |
What's typical about a windows process in regards to memory allocation in .net?
Give an example program for Getter /read-only methods in JAVA
If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
How can I tell if .net 3.5 is installed?
How many types of exception handlers are there in .NET?
Explain the Scope of public/private/friend/protected/protected friend.
What is connection pooling and how do you make your application use it?
Describe the difference between inline and code behind which is best in a loosely coupled solution?
What is RunTime Polymorphism?
5 Answers Deloitte, eClerx, Horizon, Intel, Pragna Technologies,
What is the new three features of COM+ services, which are not there in COM (MTS)
How is .net able to support multiple languages?
Difference between dispose and finallize method?