Click here to Skip to main content
16,010,392 members
Home / Discussions / Web Development
   

Web Development

 
GeneralLinefeed in normal text Pin
Brendan Vogt18-May-05 4:42
Brendan Vogt18-May-05 4:42 
GeneralRe: Linefeed in normal text Pin
Ted Ferenc18-May-05 5:30
Ted Ferenc18-May-05 5:30 
GeneralRe: Linefeed in normal text Pin
JKroschel18-May-05 10:49
JKroschel18-May-05 10:49 
GeneralRe: Linefeed in normal text Pin
niansah19-May-05 2:08
niansah19-May-05 2:08 
GeneralRe: Linefeed in normal text Pin
Brendan Vogt19-May-05 2:13
Brendan Vogt19-May-05 2:13 
GeneralRe: Linefeed in normal text Pin
niansah19-May-05 2:22
niansah19-May-05 2:22 
GeneralRe: Linefeed in normal text Pin
d_vaibhav23-May-05 2:57
d_vaibhav23-May-05 2:57 
GeneralNULL Values in CreateParameter method Pin
Brendan Vogt18-May-05 4:40
Brendan Vogt18-May-05 4:40 
Hi there,

I'm using classic ASP!!

I have an input textfield which does not require value in my SQL server database. So it is defined as to allow null values.

So, if the textfield is empty, I do the following check to make it null when adding it to the database. I don't like inserting empty strings:


Dim strDialCode

If Trim(Request.Form("txtDialCode")) = "" Then
strDialCode = Null
Else
strDialCode = Request.Form("txtDialCode")
End If


In my CreateParameter I have the following, which I am not sure if I am doing it correctly:

objCmd.Parameters.Append objCmd.CreateParameter("@ContactDialCode", adWChar, adParamInput, Len(strDialCode), strDialCode)

Basically what should happen is it must be able to accept values, and null values.


In my stored procedure (just a part is displayed) it is defined as follwoing:

CREATE Procedure sp_InsertContact
(
@ContactID nvarchar(16),
@ContactFName nvarchar(50),
@ContactLName nvarchar(50),
@ContactDialCode nvarchar(10),
@ContactTelephone nvarchar(20)
)

INSERT INTO tblContact
(
ContactID_PK,
TitleID_FK,
ContactFName,
ContactLName,
ContactDialCode,
ContactTelephone
)
VALUES
(
@ContactID,
@TitleID,
@ContactFName,
@ContactLName,
@ContactDialCode,
@ContactTelephone
)


GO


Any help or advice will be greatly appreciated!

Cheers.
Brendan
GeneralRe: NULL Values in CreateParameter method Pin
niansah19-May-05 2:33
niansah19-May-05 2:33 
GeneralRe: NULL Values in CreateParameter method Pin
Brendan Vogt19-May-05 2:39
Brendan Vogt19-May-05 2:39 
GeneralRe: NULL Values in CreateParameter method Pin
niansah19-May-05 2:42
niansah19-May-05 2:42 
GeneralRe: NULL Values in CreateParameter method Pin
Brendan Vogt19-May-05 2:56
Brendan Vogt19-May-05 2:56 
GeneralRe: NULL Values in CreateParameter method Pin
jcrussell19-May-05 20:52
jcrussell19-May-05 20:52 
GeneralUrgently need help Pin
NityaKakkar17-May-05 18:41
NityaKakkar17-May-05 18:41 
GeneralRe: Urgently need help Pin
JKroschel18-May-05 4:08
JKroschel18-May-05 4:08 
Questionhow do I secure it? Pin
Member 196994117-May-05 2:48
Member 196994117-May-05 2:48 
AnswerRe: how do I secure it? Pin
niansah17-May-05 5:39
niansah17-May-05 5:39 
GeneralRe: how do I secure it? Pin
Member 196994119-May-05 2:10
Member 196994119-May-05 2:10 
GeneralDesign templet Pin
samir_i_vohra@yahoo.com16-May-05 23:14
samir_i_vohra@yahoo.com16-May-05 23:14 
GeneralRe: Design templet Pin
Christian Graus17-May-05 13:38
protectorChristian Graus17-May-05 13:38 
GeneralRe: Design templet Pin
Yulianto.17-May-05 16:32
Yulianto.17-May-05 16:32 
GeneralPDF Server Pin
HuntTheShunt216-May-05 21:58
HuntTheShunt216-May-05 21:58 
Generallogin Problem Pin
kh_neeru16-May-05 20:12
kh_neeru16-May-05 20:12 
GeneralRe: login Problem Pin
abhi_code17-May-05 2:16
abhi_code17-May-05 2:16 
GeneralRe: login Problem Pin
MoustafaS18-May-05 2:46
MoustafaS18-May-05 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.