Click here to Skip to main content
16,004,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my DSN name is PCG


i have created DSN but dont know how to use it in code:
C#
OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ToString());

and in web config
XML
<connectionStrings>
        <add name="dbconnection" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Amir\Desktop\aaaa\aftrsachinchange\amirPCG29-4-2013\App_Data\DatabasePCG03.mdb;Persist Security Info=True" providerName="System.Data.OleDb"/>
Posted
Updated 4-May-13 0:53am
v3
Comments
Sandeep Mewara 4-May-13 6:53am    
created DSN but dont know how to use it in
I see you are using defined connection string. What is the issue?
Amirsalgar1 4-May-13 6:57am    
should i host it now?
Amirsalgar1 4-May-13 6:57am    
is their any need to use the dsn path ?
Amirsalgar1 4-May-13 6:59am    
sir ,
i am hosting website first .. please suggest me thanks in adv :)
[no name] 4-May-13 7:28am    
First thing you need to do is figure out what it is that you want to do. I do not see any DSN anywhere in the code that you have written.
"should i host it now?", what is it that you think you are hosting? Where?
"i am hosting website first", if you are hosting the website then why are you asking if you should host it?
"please suggest me", suggest what? You have not asked a question or described any kind of a problem.

1 solution

Refer to this link.You can have some idea how to do that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900