ok.. gracias por tu respuesta hv16... pero no me resulta
, te mando el codigo de la funcion para que le eches un vistazo y me digas como deberia quedar...
Function IngresarCartas(ByVal idEstampilla As String, ByVal destinatario As String, ByVal localidad As String, ByVal fechaEnvio As Date, ByVal Direccion As String ) As Integer
Dim connectionString As String = "server='(local)'; user id='cartaaspnet'; password='12345'; database='Cartas'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionStri ng)
Dim queryString As String = "INSERT INTO [IngresoCartas] ([IdEstampilla], [Destinatario], [Localidad], [FechaE"& _
"nvio], [Direccion]) VALUES (@IdEstampilla, @Destinatario, @Localidad, @FechaEnvio, @Direccion)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_idEstampilla As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_idEstampilla.ParameterName = "@IdEstampilla"
dbParam_idEstampilla.Value = idEstampilla
dbParam_idEstampilla.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_idEstampilla)
Dim dbParam_destinatario As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_destinatario.ParameterName = "@Destinatario"
dbParam_destinatario.Value = destinatario
dbParam_destinatario.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_destinatario)
Dim dbParam_localidad As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_localidad.ParameterName = "@Localidad"
dbParam_localidad.Value = localidad
dbParam_localidad.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_localidad)
Dim dbParam_fechaEnvio As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_fechaEnvio.ParameterName = "@FechaEnvio"
dbParam_fechaEnvio.Value = fechaEnvio
dbParam_fechaEnvio.DbType = System.Data.DbType.DateTime
dbCommand.Parameters.Add(dbParam_fechaEnvio)
Dim dbParam_Direccion As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_Direccion.ParameterName = "@Direccion"
dbParam_Direccion.Value = Direccion
dbParam_Direccion.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_Direccion)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
Return rowsAffected
End Function
Saludos y muchas gracias por tu ayuda
Roberto