473,563 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding data...got problem....pls help

i am beginner to link asp.net and access 2gether
i use asp .net matrix...and wrote the Insert data coding

Dim connectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Ole
DB Services=-4; Data Source=C:\Docum ents an"& _
"d Settings\AliceL ee\My Documents\db\eq uipment.mdb"
Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "INSERT INTO [test]
([SerialNumber]) VALUES (SerialNumber1) "
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim rowsAffected As Integer = 0
dbConnection.Op en
Try
rowsAffected = dbCommand.Execu teNonQuery
Finally
dbConnection.Cl ose

End Try

'Return rowsAffected

it returned--> Exception Details: System.Data.Ole Db.OleDbExcepti on: No
value given for one or more required parameters.

SerialNumber1 is a textbox that i using in the asp.net page....

can i know what is the problem???
why cant get the add the SerialNumber1.t ext into access???

Apr 23 '06 #1
2 1010
If "SerialNumb er1" is a textbox control, then its value should be

SerialNumber1.T ext

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"zh*****@gmail. com" wrote:
i am beginner to link asp.net and access 2gether
i use asp .net matrix...and wrote the Insert data coding

Dim connectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Ole
DB Services=-4; Data Source=C:\Docum ents an"& _
"d Settings\AliceL ee\My Documents\db\eq uipment.mdb"
Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "INSERT INTO [test]
([SerialNumber]) VALUES (SerialNumber1) "
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim rowsAffected As Integer = 0
dbConnection.Op en
Try
rowsAffected = dbCommand.Execu teNonQuery
Finally
dbConnection.Cl ose

End Try

'Return rowsAffected

it returned--> Exception Details: System.Data.Ole Db.OleDbExcepti on: No
value given for one or more required parameters.

SerialNumber1 is a textbox that i using in the asp.net page....

can i know what is the problem???
why cant get the add the SerialNumber1.t ext into access???

Apr 23 '06 #2
You need to concatenate your SerialNumber1.T ext value into your string.

Practice on a program that doesn't connect to the database, and learn how to
build strings.

Dim queryString As String = "INSERT INTO [test] ([SerialNumber]) VALUES ('"
& SerialNumber1.T ext & "')"

<zh*****@gmail. com> wrote in message
news:11******** *************@u 72g2000cwu.goog legroups.com...
i am beginner to link asp.net and access 2gether
i use asp .net matrix...and wrote the Insert data coding

Dim connectionStrin g As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Ole
DB Services=-4; Data Source=C:\Docum ents an"& _
"d Settings\AliceL ee\My Documents\db\eq uipment.mdb"
Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "INSERT INTO [test]
([SerialNumber]) VALUES (SerialNumber1) "
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim rowsAffected As Integer = 0
dbConnection.Op en
Try
rowsAffected = dbCommand.Execu teNonQuery
Finally
dbConnection.Cl ose

End Try

'Return rowsAffected

it returned--> Exception Details: System.Data.Ole Db.OleDbExcepti on: No
value given for one or more required parameters.

SerialNumber1 is a textbox that i using in the asp.net page....

can i know what is the problem???
why cant get the add the SerialNumber1.t ext into access???

May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2241
by: Geoff Biggs | last post by:
Evening all, I'm trying to add a new built-in number data type to Python with its own syntax, so I'm working directly with the interpreter rather than creating my own extension module (side note: I've appended something extra to the version thing in the Makefile - I doubt this is relevant to the problem but it's probably best you have all...
3
4863
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
3
1801
by: Tyler Carver | last post by:
I am trying to use some dynamic controls that are built and then added to tables. The problem that I am having is the timing of when I can populate the controls and have the state remain after a postback. The main question would be this: Why does this work for maintaining state after a postback for dynamic controls: myText = new...
0
1865
by: Sileesh | last post by:
Hi I have html table and a Button in an Aspx page. I am adding one row with some textboxes to Html table each time i click on the Button thru Javascript. Now problem is when when i try to collect the data in the Textboxes which i added dynamically from server side, i am not able to do . Alos i tried to bedug, the total no of rows in Html...
10
2330
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to the DataAdd part (Section heading is Adding Rows to a DataSet) I dont really know what to do after i have added all the
12
3555
by: Art | last post by:
Hi everyone I was hoping someone might be able to help me with this. I'm just starting to try to work with MS Access tables through VB.net. In Access I can take an existing table and add a new field with the type AutoNumber. I can then set this up as a key. Then if I go into the table I will see sequential numbers have been inserted into...
3
3884
by: diesel | last post by:
Ok, once again I'm at my wits' end with a VB.Net problem. I have a button which opens a wizard that allows the user to enter a new record to a table. I have a datatable called dtItems that stores the data from a table named Items, and a dataview called dvItems that is a sorted subset of the data in dtItems. I have a datagrid called (yes,...
9
4468
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call Controls.Add(list), where list is my ListView control, then program hangs for minute. It seems like this time depends on number of records added to...
12
6193
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the datagrid. Once I can get to that point I need some way to be able to add new data only to the new columns that were added. Here is some of my...
2
15053
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am...
0
7664
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2082
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 we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.