Hi all,
I think I have data type problem when I tried to insert data into sql server
200.
The erroe message is like this:
system.invalidc astexception
data type DFlage char(1) in sql 2000,
DMI is depdent middile initial, char(1) in database
Sex is char(1) in database, but in web page, I have "choose", "F", "M" there
values.
Here is how I deal with in asp.net code which I don't know where I am wrong.
Public Function AddDependent(By Val DFName As String, ByVal DMI As string,
ByVal DLName As String, _
ByVal Ssn As String, ByVal DSex As String, ByVal DSsn As String)
Dim pDFlag As SqlParameter = New SqlParameter("@ DFlag", SqlDbType.Char, 1)
If DFlag Then
pDFlag.Value = "Y"
Else
pDFlag.Value = "N"
End If
myCommand.Param eters.Add(pDFla g)
Dim pDMI As SqlParameter = New SqlParameter("@ MI", SqlDbType.Char, 1)
pDMI.Value = DMI
myCommand.Param eters.Add(pDMI)
Dim pDSex As SqlParameter = New SqlParameter("@ sex", SqlDbType.VarCh ar, 5)
pDSex.Value = DSex
myCommand.Param eters.Add(pDSex )
--
Betty
I think I have data type problem when I tried to insert data into sql server
200.
The erroe message is like this:
system.invalidc astexception
data type DFlage char(1) in sql 2000,
DMI is depdent middile initial, char(1) in database
Sex is char(1) in database, but in web page, I have "choose", "F", "M" there
values.
Here is how I deal with in asp.net code which I don't know where I am wrong.
Public Function AddDependent(By Val DFName As String, ByVal DMI As string,
ByVal DLName As String, _
ByVal Ssn As String, ByVal DSex As String, ByVal DSsn As String)
Dim pDFlag As SqlParameter = New SqlParameter("@ DFlag", SqlDbType.Char, 1)
If DFlag Then
pDFlag.Value = "Y"
Else
pDFlag.Value = "N"
End If
myCommand.Param eters.Add(pDFla g)
Dim pDMI As SqlParameter = New SqlParameter("@ MI", SqlDbType.Char, 1)
pDMI.Value = DMI
myCommand.Param eters.Add(pDMI)
Dim pDSex As SqlParameter = New SqlParameter("@ sex", SqlDbType.VarCh ar, 5)
pDSex.Value = DSex
myCommand.Param eters.Add(pDSex )
--
Betty
Comment