C
Chad Dittmer via .NET 247
I'm having problems inserting into Sql 2000 using SqlHelper.ExecuteScalar.
When it inserts, it only takes the first character from the string?? Any help would be appreciated. Here is the code and the stored procedure I'm using.
Dim newRowId As Integer
newRowId = Convert.ToInt32(SqlHelper.ExecuteScalar(ConfigurationSettings.AppSettings("ConnectionString"), "ProcContactsInsert", 1234, "hparameter2", "parameter2", "tparamer2", "pareter2", "ypameter2", "parTitle", "parater2", 1, 0, 1, 0, "parameer2"))
---------------------
CREATE PROCEDURE ProcContactsInsert
@CustID int,
@Cont1FirstName nvarchar,
@Cont1LastName nvarchar,
@Cont1Phone nvarchar,
@Cont1PhoneExt nvarchar,
@Cont1Fax nvarchar,
@Title nvarchar,
@Email nvarchar,
@Presort bit,
@PresortMeter bit,
@LetterShop bit,
@Printing bit,
@CellPhone nvarchar
AS
INSERT INTO Contacts (CustID, Cont1FirstName, Cont1LastName, Cont1Phone, Cont1PhoneExt, Cont1Fax, Title, Email, Presort, PresortMeter, LetterShop, Printing, CellPhone)
VALUES (@CustID, @Cont1FirstName, @Cont1LastName, @Cont1Phone, @Cont1PhoneExt, @Cont1Fax, @Title, @Email, @Presort, @PresortMeter, @LetterShop, @Printing, @CellPhone)
SELECT CAST(scope_identity() AS INTEGER)
RETURN
GO
When it inserts, it only takes the first character from the string?? Any help would be appreciated. Here is the code and the stored procedure I'm using.
Dim newRowId As Integer
newRowId = Convert.ToInt32(SqlHelper.ExecuteScalar(ConfigurationSettings.AppSettings("ConnectionString"), "ProcContactsInsert", 1234, "hparameter2", "parameter2", "tparamer2", "pareter2", "ypameter2", "parTitle", "parater2", 1, 0, 1, 0, "parameer2"))
---------------------
CREATE PROCEDURE ProcContactsInsert
@CustID int,
@Cont1FirstName nvarchar,
@Cont1LastName nvarchar,
@Cont1Phone nvarchar,
@Cont1PhoneExt nvarchar,
@Cont1Fax nvarchar,
@Title nvarchar,
@Email nvarchar,
@Presort bit,
@PresortMeter bit,
@LetterShop bit,
@Printing bit,
@CellPhone nvarchar
AS
INSERT INTO Contacts (CustID, Cont1FirstName, Cont1LastName, Cont1Phone, Cont1PhoneExt, Cont1Fax, Title, Email, Presort, PresortMeter, LetterShop, Printing, CellPhone)
VALUES (@CustID, @Cont1FirstName, @Cont1LastName, @Cont1Phone, @Cont1PhoneExt, @Cont1Fax, @Title, @Email, @Presort, @PresortMeter, @LetterShop, @Printing, @CellPhone)
SELECT CAST(scope_identity() AS INTEGER)
RETURN
GO