| | |
How to connect MSAccess database in ASP.NET
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 2
Reputation:
Solved Threads: 0
hi i am a new memeber of this group.
i am developing a web application which inserts customers details into databse when customer inserts his details on the web page.
i need help regarding code to connect MSAccess database in ASP.NET.means if user inserts the details the details should get saved in the database under respective colums of the table.if any one know the code,please help me.
waiting for reply,
thanks and regards,
i am developing a web application which inserts customers details into databse when customer inserts his details on the web page.
i need help regarding code to connect MSAccess database in ASP.NET.means if user inserts the details the details should get saved in the database under respective colums of the table.if any one know the code,please help me.
waiting for reply,
thanks and regards,
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
Use data access layer to execute sql query
see following
http://urenjoy.blogspot.com/2008/10/...-msaccess.html
Update your database name, Pass query and execute it.
see following
http://urenjoy.blogspot.com/2008/10/...-msaccess.html
Update your database name, Pass query and execute it.
•
•
Join Date: Oct 2007
Posts: 172
Reputation:
Solved Threads: 16
Here is a code to do that
public void ConnectToAccess()
{
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
database. conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data source= @"path \AccessFile.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception caught)
{
MessageBox.Show(caught.Message);
}
finally
{
conn.Close();
}
}
public void ConnectToAccess()
{
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
database. conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data source= @"path \AccessFile.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception caught)
{
MessageBox.Show(caught.Message);
}
finally
{
conn.Close();
}
}
•
•
Join Date: Oct 2008
Posts: 3
Reputation:
Solved Threads: 0
Hello There
First Open Web.Config of your Application and Write Down Following Code in Web.Config File.
in appSettings tag
add key="constr" value="Provider=Microsoft.Jet.Odbc.4.0;DSN=resume;User Id=admin;Password=admin;"
end appSettings tag
Now open your Application and write down following Connection String
OdbcConnection Objcon = new OdbcConnection(ConfigurationManager.AppSettings["constr"]);
You Get More Details on Connection String in ASP.net
ASP.net Discussion
First Open Web.Config of your Application and Write Down Following Code in Web.Config File.
in appSettings tag
add key="constr" value="Provider=Microsoft.Jet.Odbc.4.0;DSN=resume;User Id=admin;Password=admin;"
end appSettings tag
Now open your Application and write down following Connection String
OdbcConnection Objcon = new OdbcConnection(ConfigurationManager.AppSettings["constr"]);
You Get More Details on Connection String in ASP.net
ASP.net Discussion
![]() |
Similar Threads
- add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0 (ASP.NET)
- need help with sql database in asp.net using VB (ASP.NET)
- My Recipe Database ASP .NET site (Website Reviews)
- How to connect sql database in asp.net using VB? (ASP.NET)
- Clustered Cache in ASP.NET (ASP.NET)
- plz help me to connect more than one table in the ms access database to the asp.net (ASP.NET)
- asp.net tutorial (ASP)
Other Threads in the C# Forum
- Previous Thread: Copying data from one database to another
- Next Thread: Using multiple .cs files and a tabbed progarm
| Thread Tools | Search this Thread |
.net access algorithm alignment app array barchart bitmap box broadcast c# c#gridviewcolumn cast check checkbox client combobox communication concurrency control conversion csharp custom database datagrid datagridview dataset datatable datetime degrees development draganddrop drawing elevated encryption enum excel file focus form format forms function gdi+ hospitalmanagementsystem image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml






