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

getting problem in asp.net SQL update command

Hi all,
i am getting SQL update problem. as below

======================error messages =======================
Server Error in '/CMS' Application.
--------------------------------------------------------------------------------

無值提供給一或多個必要參數。
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
無值提供給一或多個必要參數。

Source Error:
Line 86: 'cmd.CommandText = "update client_list Set CLIENT_NAME
= '" & a & "' Where CLIENT_ID = 'John'"
Line 87: 'cmd.Connection = conn
Line 88: L.Text = cmd.ExecuteNonQuery()
Line 89: conn.Close()
Line 90:
Source File: c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb Line: 88

Stack Trace:
[OleDbException (0x80040e10):
無值提供給一或多個必要參數。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32
hr)

System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object&
executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior
behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
CMS.UserDetail.BUpdate_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

================================================== ============

================My code===============================
Private Sub BUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BUpdate.Click
Dim DBPath As String
Dim SQLUpdate, a As String
DBPath = "C:\Inetpub\wwwroot\CMS\cms.mdb"

SQLUpdate = "Update client_list Set HKID='" & Me.TBHKID.Text &
"',CLIENT_NAME = '" & Me.TBClientName.Text & "' ,ADDRESS='" &
Me.TBAddress.Text & "',SEX='" & Me.DDLSex.SelectedItem.Text &
"',TELEPHONE='" & Me.TBTelephone.Text & "',DATE_OF_BIRTH='" &
Me.TBDirth.Text & "',EMAIL='" & Me.TBEmail.Text & "' Where CLIENT_ID =
'John'" ',HKID='" & Me.TBHKID.Text & "',ADDRESS='" & Me.TBAddress.Text
& "',SEX='" & Me.DDLSex.SelectedItem.Text & "',TELEPHONE='" &
Me.TBTelephone.Text & "',DATE_OF_BIRTH='" & Me.TBDirth.Text &
"',EMAIL='" & Me.TBEmail.Text & "' "
Dim connStr As String = "Provider=microsoft.Jet.OLEDB.4.0;Data
Source=" & DBPath & ""
Dim conn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbCommand

conn = New System.Data.OleDb.OleDbConnection(connStr)

conn.Open()
cmd = New System.Data.OleDb.OleDbCommand(SQLUpdate, conn)
L.Text = cmd.ExecuteNonQuery()
conn.Close()
End Sub
=====================================

anyone can help me

THX

Jan 29 '06 #1
1 4950
Enclose your code in a Try Catch Block something like this. Set a breakpoint
before this point and execute line by line until you get the exception, when
you do follow it into the exception block and check the value of the message
of the exception, this should give you more information. ?

SqlCommand.CommandText = sqlString
sqlCommand.Connection = sqlConnection

Dim ArticleID As Integer

Try

sqlConnection.Open()
If sqlCommand.ExecuteNonQuery() > 0 Then
result = True
End If

Catch ex As Exception
result = False
Finally
sqlConnection.Close()
End Try
--
Terry Burns
http://TrainingOn.net


<th*******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi all,
i am getting SQL update problem. as below

======================error messages =======================
Server Error in '/CMS' Application.
--------------------------------------------------------------------------------

??????????????
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
??????????????

Source Error:
Line 86: 'cmd.CommandText = "update client_list Set CLIENT_NAME
= '" & a & "' Where CLIENT_ID = 'John'"
Line 87: 'cmd.Connection = conn
Line 88: L.Text = cmd.ExecuteNonQuery()
Line 89: conn.Close()
Line 90:
Source File: c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb Line: 88

Stack Trace:
[OleDbException (0x80040e10):
??????????????]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32
hr)

System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object&
executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior
behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
CMS.UserDetail.BUpdate_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

================================================== ============

================My code===============================
Private Sub BUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BUpdate.Click
Dim DBPath As String
Dim SQLUpdate, a As String
DBPath = "C:\Inetpub\wwwroot\CMS\cms.mdb"

SQLUpdate = "Update client_list Set HKID='" & Me.TBHKID.Text &
"',CLIENT_NAME = '" & Me.TBClientName.Text & "' ,ADDRESS='" &
Me.TBAddress.Text & "',SEX='" & Me.DDLSex.SelectedItem.Text &
"',TELEPHONE='" & Me.TBTelephone.Text & "',DATE_OF_BIRTH='" &
Me.TBDirth.Text & "',EMAIL='" & Me.TBEmail.Text & "' Where CLIENT_ID =
'John'" ',HKID='" & Me.TBHKID.Text & "',ADDRESS='" & Me.TBAddress.Text
& "',SEX='" & Me.DDLSex.SelectedItem.Text & "',TELEPHONE='" &
Me.TBTelephone.Text & "',DATE_OF_BIRTH='" & Me.TBDirth.Text &
"',EMAIL='" & Me.TBEmail.Text & "' "
Dim connStr As String = "Provider=microsoft.Jet.OLEDB.4.0;Data
Source=" & DBPath & ""
Dim conn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbCommand

conn = New System.Data.OleDb.OleDbConnection(connStr)

conn.Open()
cmd = New System.Data.OleDb.OleDbCommand(SQLUpdate, conn)
L.Text = cmd.ExecuteNonQuery()
conn.Close()
End Sub
=====================================

anyone can help me

THX
Jan 29 '06 #2

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

Similar topics

11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
5
by: Brian Henry | last post by:
I have a page which reads an article from the database it has 1 text box, 2 dropdown lists, and a longreat HTML text box. I load the information from the database when the page is set to edit mode...
4
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft...
17
by: Benoit Martin | last post by:
I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset...
13
by: dennis | last post by:
Hello, I'm having trouble solving the following problem with DB2 UDB 8.2. I need to create a trigger that performs certain extra constraint validations (temporal uniqueness). One of the tables...
0
by: JimN1 | last post by:
Error: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. This is a continuation of my previous table element update question. I am now getting the above...
1
by: Rafael Fernandez | last post by:
Hi folks, I have the following sql/pl: CREATE PROCEDURE DBSTG.TEST (OUT PRESULT INTEGER ) SPECIFIC DBSTG.TEST DYNAMIC RESULT SETS 1 LANGUAGE SQL
1
by: Selvakumar | last post by:
hai friends, I am new to .net programming. I did the inserting data into MS-access database but i couldn't able to perform the update command. I used only textbox and command button for inserting...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.