473,499 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can anybody tell me the provider name

21 New Member
following is the code that i am calling in my button event i am actually making a table and the the data that is entered is actually saving in my "book.mdf" table
the error that i am getting is that "unrecognised database" it is i think most probably due to the wrong provider name that i am giving i actually dont know the provider name

here is the code

Expand|Select|Wrap|Line Numbers
  1. // set Access connection and select strings
  2.             string strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;" +
  3.             " Data Source=D:/asp.net apps/application/App_Data/book.mdf";
  4.             string strSQL = "INSERT INTO book " +
  5.             "( Name,Address,Email,Comments)" +
  6.             "VALUES ('" + NAMETextBox.Text.ToString() + " ',' "
  7.             + ADDRESSTextBox.Text.ToString() + " ', '"
  8.             + EMAILTextBox.Text.ToString()
  9.             + " ',' " + COMMENTTextBox.Text.ToString() + " ')";
  10.  
  11.              // Create oleDbDataAdapter
  12.             OleDbConnection myConn = new OleDbConnection(strDSN);
  13.  
  14.              //Create ole Db Command And call ExecuteNonQuery to execute
  15.              // a SQL statement
  16.             OleDbCommand myCmd = new OleDbCommand(strSQL, myConn);
  17.              try
  18.             {
  19.                 myConn.Open();
  20.                  myCmd.ExecuteNonQuery();
  21.             }
  22.             catch (Exception exp)
  23.             {
  24.                 Console.WriteLine("Error: {0}", exp.Message);
  25.             }
  26.             myConn.Close();
  27.              // open Thans.aspx page after adding entries to the guest book
  28.             Response.Redirect("thanxx.aspx");
  29.          }  
i shallbe very thankful to ya if you help me out in this matter
regards furqan ahmed a.k.a furqi
thanxxx
Jan 30 '10 #1
1 1195
Frinavale
9,735 Recognized Expert Moderator Expert
Check out Connection String Syntax (ADO.NET) to make sure that you've created a proper connection string.

-Frinny
Feb 1 '10 #2

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

Similar topics

2
10533
by: Jozef | last post by:
Hello, I'm trying to find a way to see who or how many connections, (or both) are open on a single access database. What I'm trying to do is find out who is logged in and hopefully...
6
14093
by: Duncan Winn | last post by:
I have written an Ole Db provider. It seems to be registered in the Operating system to a degree, but not fully, i.e. I can access it from a client that I have written. But it does not appear in...
2
1961
by: | last post by:
Hi all, How can I get a reference to my custom profile provider in my .aspx page? I have looked at httpcontext.current.profile. But from there where do I go? Ideally I would like to be able to...
2
4245
by: John | last post by:
Hi I am trying to setup a customised membership provider and I am getting the following error when trying to run the app; The entry 'AspNetSqlMembershipProvider' has already been added. The...
4
7208
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to...
0
1311
by: jwallis | last post by:
I have two systems, one for 'Test' and one for 'Live' and each has a Sql Server. When 'Test' code is published to 'Live' I currently have to edit connection strings in web.config to ensure that...
5
8267
by: Alias | last post by:
Hi - I'm trying to implement a custom RoleProvider based on the SqlRoleProvider. I keep receiving a an error that it can't load type 'MyRoleTest.MyRoleProvider' when trying to load my...
11
2075
by: Weston Weems | last post by:
I've got the need to have user information for logged in user in a readily avaliable page context (a lot like how Profile is) except not suck. Before we jump to any conclusions, from what I...
9
3258
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
6
5639
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps...
0
7006
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
7215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5467
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,...
1
4917
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...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.