473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 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 1380
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 connections means exactly. Does this mean that only 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 running on the server and all of them use the...
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 practice to open connections as late as possible and...
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 SQL 2000 DB on another W2K server. I have set...
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 says it's a .net problem. Here's the problem, we're...
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. I'm using the gcnew operator in two different...
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 I'm used to doing with ADO (previous ADO...
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 someone can point me to where to go: I have splitted...
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 netstat viewer to see if there is any connection open...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.