conversion from string to double error

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 9
Reputation: pritia is an unknown quantity at this point 
Solved Threads: 0
pritia pritia is offline Offline
Newbie Poster

conversion from string to double error

 
0
  #1
Dec 7th, 2007
i need some help here
i have design a gridview which contains two columns with dropdown list first is emp_id column n second is orderofwork column...when i try to update database with selected values in dropdown it gives me the following error

Conversion from string "update subj_emp_assign set emp_i" to type 'Double' is not valid.

in database emp_id is varchar n orderofwork is int

Dim newEmpId As String
Dim workorder As Integer
newEmpId = CType(gvwJobDetails.Rows(e.RowIndex).Cells(2).Controls(1), DropDownList).SelectedItem.Text
workorder = CInt(CType(gvwJobDetails.Rows(e.RowIndex).Cells(4).Controls(1), DropDownList).SelectedItem.Text)


sqlcmd = New SqlCommand("update subj_emp_assign set emp_id='" + newEmpId.Trim() + "',order_of_work=" + Integer.Parse(workorder) + " where subj_id='" + subjId.Trim() "' ", sqlConn)
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: conversion from string to double error

 
0
  #2
Dec 7th, 2007
are u using sqlserver? i had error like this before, and actualy you can't to update or add string to double. if your empid is double, you cannot insert with string.
check the fields type again..
Ok. see u
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC