wondery Posted October 14, 2003 Posted October 14, 2003 when i insert data into sqlserver i check in stringsql yet that return '' < == empty value but y it insert it return 1/1/1900 :confused: how to slove this ?? Quote
wyrd Posted October 14, 2003 Posted October 14, 2003 Assuming I understood any of that.. try inserting the value 'NULL' instead of a blank string. Quote Gamer extraordinaire. Programmer wannabe.
*Experts* jfackler Posted October 14, 2003 *Experts* Posted October 14, 2003 I agree with Wyrds implied point about your question being hard to decipher. That being said, I assume your variable is a Date type. If you do not assign an initial value to a variable, Visual Basic .Net will initialize your varialbles for you during compilation based on the variables type. Quote
Administrators PlausiblyDamp Posted October 14, 2003 Administrators Posted October 14, 2003 Does the database have a default specified (or a trigger that generates a default value)? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wondery Posted October 15, 2003 Author Posted October 15, 2003 PlausiblyDamp : no defaul specified jfackler : here is my code in field first, filingDate, Issue, mailed and publish is DateTime Format string strsql3 = "INSERT INTO tblTrademark(AppNo,RegNo," +"StatusName,TypeName,NewOrCon,Your," +"CountryName,AgentName,TrademarkName,TrademarkColor," +"Notes,FirstContact,FilingDate,Issued,Mailed," +"Publish,Related,Priority,Correspondens,AgentRef,ApplicantRef," +"OwnerRef,Entered,Modified,UserName) " +"VALUES(N'" + txtAppNo.Text + "',N'" + txtRegNo.Text + "',N'" + ddlStatus.SelectedItem.Value + "',N'" + ddlType.SelectedItem.Value + "',N'" + ddlNew.SelectedItem.Value + "',N'" + txtYour.Text + "',N'" + ddlCountry.SelectedItem.Value + "',N'" + ddlAgent.SelectedItem.Value + "',N'" + txtTrademark.Text + "',N'" + ddlColor.SelectedItem.Value + "',N'" + txtNotes.Text + "','" + txtFirst.Text + "','" + txtFiling.Text + "','" + txtIssued.Text + "','" + txtMail.Text + "','" + txtPublish.Text + "',N'" + txtRelated.Text + "',N'" + txtPriority.Text + "',N'" + txtCorespondens.Text + "',N'" + txtAgentRef.Text + "',N'" + txtAppRef.Text + "',N'" + txtOwnerRef.Text + "',N'" + DateTime.Now + "',N'" + DateTime.Now + "',N'" + Session["User"] + "')"; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.