473,408 Members | 1,743 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,408 software developers and data experts.

Error: Argument 'Prompt' cannot be converted to type 'String'

I am trying to update a record though a stored procedure and
parameters, but I keep getting this error:

Additional information: Argument 'Prompt' cannot be converted to type
'String'.
Any ideas?

Here is the code

Public Function UpdateClient()

Dim dapClients As System.Data.SqlClient.SqlDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
'Specify a connection for a data adpter that
'fills the data set used on the form.
Dim conn As System.Data.SqlClient.SqlConnection _
= New System.Data.SqlClient.SqlConnection(Utilities.GetC onnectionString())
'Specify the command and data adpter that serves
'as the source for the data set on the form
conn.Open()

Dim cmd As System.Data.SqlClient.SqlCommand = _
New System.Data.SqlClient.SqlCommand("UpdClient", conn)
cmd.CommandType = CommandType.StoredProcedure

'Declare Parameters
Dim prmClientID As SqlClient.SqlParameter = _
cmd.Parameters.Add("@ClientID", SqlDbType.Int, 4,
"ClientID")
prmClientID.Direction = ParameterDirection.Input
prmClientID.IsNullable = False
prmClientID.Value = CInt(ClientID)

Dim prmClientCode As SqlClient.SqlParameter = _
cmd.Parameters.Add("@ClientCode", SqlDbType.Char, 10,
"ClientCode")
prmClientCode.Direction = ParameterDirection.Input
prmClientCode.IsNullable = False
prmClientCode.Value = ClientCode

Dim prmClientName As SqlClient.SqlParameter = _
cmd.Parameters.Add("@ClientName", SqlDbType.Char, 50,
"ClientName")
prmClientName.Direction = ParameterDirection.Input
prmClientName.IsNullable = True
prmClientName.Value = Name

Dim prmClientDescription As SqlClient.SqlParameter = _
cmd.Parameters.Add("@ClientDescription", SqlDbType.Char,
255, "ClientDescription")
prmClientDescription.Direction = ParameterDirection.Input
prmClientDescription.IsNullable = True
prmClientDescription.Value = ClientDescription

Dim prmBillingContact As SqlClient.SqlParameter = _
cmd.Parameters.Add("@BillingContact", SqlDbType.Char, 50,
"BillingContact")
prmBillingContact.Direction = ParameterDirection.Input
prmBillingContact.IsNullable = True
prmBillingContact.Value = BillingContact

Dim prmOtherContact As SqlClient.SqlParameter = _
cmd.Parameters.Add("@OtherContact", SqlDbType.Char,
50, "OtherContact")
prmOtherContact.Direction = ParameterDirection.Input
prmOtherContact.IsNullable = True
prmOtherContact.Value = OtherContact

Dim prmOtherContactDesc As SqlClient.SqlParameter = _
cmd.Parameters.Add("@OtherContactDesc",
SqlDbType.Char, 255, "OtherContactDesc")
prmOtherContactDesc.Direction = ParameterDirection.Input
prmOtherContactDesc.IsNullable = True
prmOtherContactDesc.Value = OtherContactDesc

Dim prmStreetAddress As SqlClient.SqlParameter = _
cmd.Parameters.Add("@StreetAddress", SqlDbType.Char, 150,
"StreetAddress")
prmStreetAddress.Direction = ParameterDirection.Input
prmStreetAddress.IsNullable = True
prmStreetAddress.Value = StreetAddress

Dim prmStreetCity As SqlClient.SqlParameter = _
cmd.Parameters.Add("@StreetCity", SqlDbType.Char, 50,
"StreetCity")
prmStreetCity.Direction = ParameterDirection.Input
prmStreetCity.Value = StreetCity

Dim prmStreetState As SqlClient.SqlParameter = _
cmd.Parameters.Add("@StreetState", SqlDbType.Char, 2,
"StreetState")
prmStreetState.Direction = ParameterDirection.Input
prmStreetState.IsNullable = True
prmStreetState.Value = StreetState

Dim prmStreetZip As SqlClient.SqlParameter = _
cmd.Parameters.Add("@StreetZip", SqlDbType.Char, 10,
"StreetZip")
prmStreetZip.Direction = ParameterDirection.Input
prmStreetZip.IsNullable = True
prmStreetZip.Value = StreetZip

Dim prmMailSameAsStreet As SqlClient.SqlParameter = _
cmd.Parameters.Add("@MailSameAsStreet", SqlDbType.Bit, 1)
prmMailSameAsStreet.Direction = ParameterDirection.Input
prmMailSameAsStreet.IsNullable = True
prmMailSameAsStreet.Value = MailSameAsStreet

Dim prmMailAddress As SqlClient.SqlParameter = _
cmd.Parameters.Add("@MailAddress", SqlDbType.Char, 150,
"MailAddress")
prmMailAddress.Direction = ParameterDirection.Input
prmMailAddress.IsNullable = True
prmMailAddress.Value = MailAddress

Dim prmMailCity As SqlClient.SqlParameter = _
cmd.Parameters.Add("@MailCity", SqlDbType.Char, 50,
"MailCity")
prmMailCity.Direction = ParameterDirection.Input
prmMailCity.IsNullable = True
prmMailCity.Value = MailCity

Dim prmMailState As SqlClient.SqlParameter = _
cmd.Parameters.Add("@MailState", SqlDbType.Char, 2,
"MailState")
prmMailState.Direction = ParameterDirection.Input
prmMailState.IsNullable = True
prmMailState.Value = MailState

Dim prmMailZip As SqlClient.SqlParameter = _
cmd.Parameters.Add("@MailZip", SqlDbType.Char, 10,
"MailZip")
prmMailZip.Direction = ParameterDirection.Input
prmMailZip.IsNullable = True
prmMailZip.Value = MailZip

Dim prmPhone As SqlClient.SqlParameter = _
cmd.Parameters.Add("@Phone", SqlDbType.Char, 10, "Phone")
prmPhone.Direction = ParameterDirection.Input
prmPhone.IsNullable = True
prmPhone.Value = Phone

Dim prmExtention As SqlClient.SqlParameter = _
cmd.Parameters.Add("@Extention", SqlDbType.Char, 10,
"Extention")
prmExtention.Direction = ParameterDirection.Input
prmExtention.IsNullable = True
prmExtention.Value = Extention

Dim prmFax As SqlClient.SqlParameter = _
cmd.Parameters.Add("@Fax", SqlDbType.Char, 10, "Fax")
prmfax.Direction = ParameterDirection.Input
prmfax.IsNullable = True
prmfax.Value = Fax

Dim prmComments As SqlClient.SqlParameter = _
cmd.Parameters.Add("@Comments", SqlDbType.Char, 255,
"Comments")
prmComments.Direction = ParameterDirection.Input
prmComments.IsNullable = True
prmComments.Value = Comments

Dim prmNumberOfPhotos As SqlClient.SqlParameter = _
cmd.Parameters.Add("@NumberOfPhotos", SqlDbType.Int,
4)
prmNumberOfPhotos.Direction = ParameterDirection.Input
prmNumberOfPhotos.IsNullable = True
prmNumberOfPhotos.Value = CInt(NumberOfPhotos)

Dim prmActive As SqlClient.SqlParameter = _
cmd.Parameters.Add("@Active", SqlDbType.Bit, 1)
prmActive.Direction = ParameterDirection.Input
prmActive.IsNullable = True
prmActive.Value = Active

Dim prmConfirmationLetter As SqlClient.SqlParameter = _
cmd.Parameters.Add("@ConfirmationLetter",
SqlDbType.Bit, 1)
prmConfirmationLetter.Direction = ParameterDirection.Input
prmConfirmationLetter.IsNullable = True
prmConfirmationLetter.Value = ConfirmationLetter

Dim prmInspectLockOuts As SqlClient.SqlParameter = _
cmd.Parameters.Add("@InspectLockOuts", SqlDbType.Bit, 1)
prmInspectLockOuts.Direction = ParameterDirection.Input
prmInspectLockOuts.IsNullable = True
prmInspectLockOuts.Value = InspectLockOuts

Dim prmCreditMaterialOS As SqlClient.SqlParameter = _
cmd.Parameters.Add("@CreditMaterialOS", SqlDbType.Bit, 1)
prmCreditMaterialOS.Direction = ParameterDirection.Input
prmCreditMaterialOS.IsNullable = True
prmCreditMaterialOS.Value = CreditMaterialOS

Dim prmLastEditedUserID As SqlClient.SqlParameter = _
cmd.Parameters.Add("@LastEditedUserID", SqlDbType.Int, 4)
prmLastEditedUserID.Direction = ParameterDirection.Input
prmLastEditedUserID.IsNullable = False
prmLastEditedUserID.Value = LastEditedUserId

Dim rows As Integer = cmd.ExecuteNonQuery()

If rows = 0 Then
MsgBox("Did not work")
Else
MsgBox("Worked")
End If

conn.Close()

End Function
'''''''''''''''''''''''''''
Store Procedure
'''''''''''''''''''''''''''
CREATE procedure updClient
@ClientID int,
@ClientCode char(10),
@ClientName Char(50),
@ClientDescription Char(255),
@BillingContact char(10),
@OtherContact char(50),
@OtherContactDesc char(255),
@StreetAddress char(150),
@StreetCity char(50),
@StreetState char(2),
@StreetZip char(10),
@MailSameAsStreet bit,
@MailAddress char(150),
@MailCity char(50),
@MailState char(2),
@MailZip char(10),
@Phone char(10),
@Extention char(10),
@Fax char(10),
@Comments char(255),
@NumberOfPhotos int,
@Active bit,
@ConfirmationLetter bit,
@InspectLockOuts bit,
@CreditMaterialsOS bit,
@LastEditedUserID int
as
Update clients set ClientCode = @ClientCode,
ClientDescription =@ClientDescription,
ClientName =@ClientName,
BillingContact= @BillingContact,
OtherContact = @OtherContact,
OtherContactDesc = @OtherContactDesc,
StreetAddress = @StreetAddress,
StreetCity = @StreetCity,
StreetState = @StreetState,
StreetZip = @Streetzip,
MailSameAsStreet = @MailSameAsStreet,
MailAddress = @MailAddress,
MailCity = @MailCity,
MailState = @MailState,
MailZip = @MailZip,
Phone = @Phone,
Extention = @Extention,
Fax = @Fax,
Comments = @Comments,
NumberOFPhotos = @NumberOfPhotos,
Active = @Active ,
ConfirmationLetter = @ConfirmationLetter,
InspectLockOuts = @InspectLockOuts,
CreditMaterialOS = @CreditMaterialsOS,
LastEditedUserId = @LastEditedUserID,
LastEditedTime = getdate()
Where Clients.ClientID = @ClientID
GO
Nov 20 '05 #1
1 8251
"Caroline" <ca************@hotmail.com> schrieb
I am trying to update a record though a stored procedure and
parameters, but I keep getting this error:

Additional information: Argument 'Prompt' cannot be converted to
type 'String'.


Is it a compile error or a runtime error? At which line?
If it's an ADO.net problem, please turn to
microsoft.public.dotnet.framework.adonet
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

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

Similar topics

1
by: James | last post by:
Hello Java NG, I not sure if this is the right NG for this type of question but if not please let me know which is, TIA Any way first off let me say I'm a student and this WAS last weeks lab,...
1
by: Azzedine | last post by:
Dear All, I compiled a project under Unix, I have got the following errors: ------------------------------------------ CC -I. -DUNIX -c XPCFileStat.C -g -o XPCFileStat.o "XPCFileStat.C",...
4
by: ItsMe | last post by:
Hi Guyz, I'm unable to understand this (AddressOf) error??? In VB6 I have two functions: ---------------------------- Public Function ImageFirstImageCallback(ByVal hWnd As Integer, ByVal...
2
by: DazedAndConfused | last post by:
I converted a C# example of using dll crypt32 to VB .NET. The converted example fails when Encypting/Decypting. I found that if instead of defining a variable as and setting the values for...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
2
by: Dabbler | last post by:
I'm getting the following error when I try and insert a row using FormView, ObjectDataSource and stored procedure. The form has 40+ columns on it and I'm not sure how to diagnose where the problem...
7
by: bowlderster | last post by:
Hello,all. I want to get the array size in a function, and the array is an argument of the function. I try the following code. /*************************************** */ #include<stdio.h>...
2
by: ghostrider | last post by:
I've been trying to clear these error messages that I keep getting, was wondering if someone could help me out here. 1. Value of type '1-dimensional array of String' cannot be converted to...
63
by: Kapteyn's Star | last post by:
Hi newsgroup The program here given is refused by GCC with a error i cannot understand. It says rnd00.c: In function ‘main’: rnd00.c:26: error: expected expression before ‘]’ token ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
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,...
0
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
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...

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.