472,354 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

confused with connections in asp.net

232 100+
i m from asp background
i m very new to asp.net
n i m confused with connections in asp.net
i have a project in asp.net for practice
its web.config file which i think is a connection file has connection with sql express
what should i do to connect it with sql server 2005
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?xml version="1.0"?>
  3. <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  4. <appSettings/>
  5. <connectionStrings>
  6. <add name="ConnectionString" connectionString="Data Source=localhost\SQLExpress;Initial Catalog=asd;Integrated Security=True" providerName="System.Data.SqlClient"/>
  7. </connectionStrings>
  8. <system.web>
  9. <compilation debug="true"/>
  10. <authentication mode="Windows"/>
  11.  
  12.  
  13. </system.web>
  14.  
  15. </configuration>
  16.  
Feb 1 '09 #1
8 1340
Bassem
344 100+
Simple connectionString
<add name="dbConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\dbName.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
Now put your database in the data directroy.
I hope it will help!
Regards,
Bassem
Feb 1 '09 #2
kkshansid
232 100+
but i hav to connect it with sql server 2000 or 2005 which hav username and password and server authentication mode.your connection is still with sql express
Feb 2 '09 #3
kunal pawar
297 100+
See "Data Source" is your sever name. Like tt\SQLExpress or may be TT its depeands when you install Sql Server 2005.

Or you can refer connectionstrings.com
Feb 2 '09 #4
Hi kkshansid,
You can have the connectionstring in the web.config file like this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <!-- Connection strings-->
  3. <connectionStrings>
  4. <remove name="MyConnectionString"></remove>
  5. <add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;User ID=mysqlusername;Password=mypassword;pooling=false" providerName="System.Data.SqlClient"/>
  6. </connectionStrings>
  7.  
Hope this helps.
Feb 2 '09 #5
kkshansid
232 100+
what about authentication mode windows mode dont take user id and password
Feb 2 '09 #6
You can just use Integrated Security=true in the connection string if you are going to use Windows Authentication mode.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!-- Connection strings-->
  3. <connectionStrings>
  4. <remove name="MyConnectionString"></remove>
  5. <add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;Integrated Security=true;pooling=false" providerName="System.Data.SqlClient"/>
  6. </connectionStrings>
  7.  
Waiting you feedback. Thanks.
Feb 2 '09 #7
kkshansid
232 100+
sql server 2005 details
server name=kkshansid
user id=sa
password=
it is sql server 2005 not sql express
what should be authentication mode?
Feb 2 '09 #8
Now perhaps it is my turn to be confused! It seems you have some different requirement. I hope this link provides you much guidance.

http://www.connectionstrings.com/sql-server-2005

Hope you find the right connection string here. Thank you.
Feb 2 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50...
4
by: Angelos | last post by:
I get this error mysql_pconnect Too many connections ... every now and then. Does anyone knows where it comes from ? There are a lot of sites...
1
by: C Sharp beginner | last post by:
I'm sorry about this verbose posting. This is a follow-up to my yesterday's posting. Thanks William for your reply. I understand it is a good...
2
by: Bob | last post by:
We have a production web site that's data intensive (save user input to DB and query for displaying) with the ASP.NET app part on one W2K server and...
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far...
15
by: cedgington | last post by:
I wanted to take advantage of the large set of functionality offered by the framework, so for my latest project I'm using managed C++ with .NET v2....
6
by: Sam Malone | last post by:
Am I just totally missing something here? I'm just new to VS.NET 2005 (using VB.NET) and ADO.NET. I get the impression that ADO.NET can't do what...
43
by: perryche | last post by:
I have searched the site and probably came across dozens of posts... I am somewhat confused about the replies... here is my situation, see if...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.