473,401 Members | 2,068 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,401 software developers and data experts.

Problem in accessing MSAccess

I am not able to insert values into msacess what could be the error in the below shown statement?

Expand|Select|Wrap|Line Numbers
  1.  
  2. string con = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Database2.mdb");
  3.        using (OleDbConnection connection = new OleDbConnection(con))
  4.        {
  5.            using (OleDbCommand cmd = new OleDbCommand("insert into Connpool (bookid,bookname,amt) values (?,?,?)", connection))
  6.            {
  7.                cmd.CommandType = CommandType.Text;
  8.                cmd.Parameters.AddWithValue("bookid", TextBox1.Text);
  9.                cmd.Parameters.AddWithValue("bookname", TextBox2.Text);
  10.                cmd.Parameters.AddWithValue("amt", TextBox3.Text);
  11.                connection.Open();
  12.                cmd.ExecuteNonQuery();
  13.                connection.Close();
  14.  
  15.            }
  16.  
  17.        }
  18.  
Jul 25 '08 #1
3 891
r035198x
13,262 8TB
What happens whne you run that code? Do you get an error message?
Jul 25 '08 #2
Thax a lot sir it works well now
Jul 25 '08 #3
r035198x
13,262 8TB
Thax a lot sir it works well now
Credit should be given to you for getting it to work not me. I didn't do anything.
Jul 25 '08 #4

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

Similar topics

15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
2
by: Lauren Quantrell | last post by:
Running Access2000 ADP Project/MSDE on Windows XP... - I Open my Access ADP project. In the Windows Task Manager Processes window MSACCESS.EXE shows up. - I don't do anything else in Access. - I...
10
by: Andrea M. Segovia | last post by:
Hello, I am a newbie to Oracle databases.... We have a visualization front-end tool connected to an Oracle back-end database on a Tru64 UNIX server. We also have clients with MS access...
1
by: sudha | last post by:
how can i access msaccess by using c programing language pls specify the way
3
by: moondaddy | last post by:
I need to start an ms access 2003 app from a vb.net winforms app and didn't want to load all the interop stuff for office into the .net project. I thought that using the shell cmd would be a nice...
4
by: Steve Jorgensen | last post by:
Generally, it is the case that space characters in the names of things can cause difficulties, and removing the spaces can make things work more smoothly, but I recently found a reverse case. I...
2
by: sapan | last post by:
Hi guys, I have a situation where in I need to access MSAccess database ,use that data and put it into a flat file. All this using VB script. and the main hurdle is that I am not wellversed with VB...
1
by: habeeb | last post by:
hello i need help, i want to know how we can access a table in Msaccess database of one computer using another computer. I tried by giving the path of one computer in the data source path of...
13
yolenman
by: yolenman | last post by:
Hello - This is my first posting to this group, so please bear with me. Also note, that while I'm intelligent, databases are not in my field of knowledge. I'm working with a small limousine...
1
by: sekaryar | last post by:
Hi guys, Am facing problem in accessing data from MsAccess by javascript..Plz help me to sort it out. Regards, Sekar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.