ASP.NET

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentASP.NET

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old February 17th, 2012, 03:45 PM
vqcheese vqcheese is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 3 vqcheese User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 47 sec
Reputation Power: 0
ASP question

Im doing a simple form of 21 fields that rights to a sql table.
my issue is i cant get it to work unless i have all variables as strings and strings fields in my tables.

here is my code and if i try to put in a field as integer or date it errors out. Im using VS 2008



my variables

Dim strinjnumber AsString
Dim strEmpID AsString
Dim dtInjDate AsString'dates
Dim dtInjTime AsString'dates
Dim strOsha AsString
Dim strinjLoc AsString
Dim strspecloc AsString
Dim strbodypart AsString
Dim strinjnature AsString
Dim strrootcause AsString
Dim strinjcause AsString
Dim strsafeprov AsString
Dim strsafeused AsString
Dim strtreatment AsString
Dim strmissed AsString
Dim strrestricted AsString
Dim strwhathappend AsString
Dim strcorrective AsString
Dim strdeptid AsString
Dim strshift AsString
Dim strhoursintoshift AsString


my code:

Dim sqlcon AsNew SqlConnection("server=tpmpi01;database=vq-dsi;uid=bk;password=valley")
'checking if connection is open. if open close it and open again.
If sqlcon.State = ConnectionState.Open Then
sqlcon.Close()
EndIf
sqlcon.Open()
Dim strcommand AsString
'the insert command is stored in strcommand
'Table Name : Contact
'Column of table : Name, Place

strcommand = "Insert into Injury(injnmbr, empID, injdate, injtime,osha, injLoc, specloc, bodypart, injnature,rootcause, injcause, safeguardsprovided, safeguardsused, treatment, daysmissed, daysrestricted, whathappend, correctiveaction, deptid, shift, hoursintoshift) values ('" + strinjnumber + "','" + strEmpID + "','" + dtInjDate + "','" + dtInjTime + "','" + strOsha + "','" + strinjLoc + "','" + strspecloc + "','" + strbodypart + "','" + strinjnature + " ','" + strrootcause + "','" + strinjcause + "','" + strsafeprov + "','" + strsafeused + "','" + strtreatment + "','" + strmissed + "','" + strrestricted + "','" + strwhathappend + "','" + strcorrective + "','" + strdeptid + "','" + strshift + "','" + strhoursintoshift + "')"

Reply With Quote
  #2  
Old February 22nd, 2012, 02:45 PM
vqcheese vqcheese is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 3 vqcheese User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 47 sec
Reputation Power: 0
does anyone have any ideas on this? im stuck.

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP.NET > ASP question


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap