473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cast from string "" to type 'Double is not valid

111 100+
Hii all,

when im trying to click on a selected item in teh combobox and click on search, im getting this error..

can anyone help..
Jul 2 '07 #1
4 4444
r035198x
13,262 8TB
Hii all,

when im trying to click on a selected item in teh combobox and click on search, im getting this error..

can anyone help..
Show the code you're using. If a user supplies a string and you want to use it as a decimal you have to convert it to double first.
Jul 2 '07 #2
rhepsi
111 100+
Show the code you're using. If a user supplies a string and you want to use it as a decimal you have to convert it to double first.
hey this is the code : the line where im gettign an error

Search_buttonclick

strID = drSQL.Item("pr_project_manager_id_fk").ToString()
'FindItemByID(cbPrMgr, strID)


plz help..
thnx
Jul 2 '07 #3
r035198x
13,262 8TB
hey this is the code : the line where im gettign an error

Search_buttonclick

strID = drSQL.Item("pr_project_manager_id_fk").ToString()
'FindItemByID(cbPrMgr, strID)


plz help..
thnx
If strID is a string, and your FindItemByID requires the second argument to be double, then you need to use double.Parse to convert it to double first.
Jul 2 '07 #4
rhepsi
111 100+
If strID is a string, and your FindItemByID requires the second argument to be double, then you need to use double.Parse to convert it to double first.

hii thnx for ur reply...

code for FindItemByID is:

Private Sub FindItemByID(ByVal cbCombo As ComboBox, ByVal strID As String)
' This sub is used to find an Item in a combobox and
' set the selected index of the combo box to that item
Dim bFound As Boolean
Dim ListItem As ListItem
Dim ItemCount As Integer

ListItem = New ListItem

ItemCount = 0
While Not bFound Or ItemCount <= cbCombo.Items.Count - 1
ListItem = CType(cbCombo.Items(ItemCount), ListItem)

If ListItem.ID = CInt(strID) Then
cbCombo.SelectedIndex = ItemCount
bFound = True
End If
ItemCount += 1
End While

If Not bFound Then
cbCombo.SelectedIndex = -1
End If

End Sub


then wat shd i change...

plz help.. thnx
Jul 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is it possible to alter the string type? Basicly what i want to do is to create my own string type. lets call it sqlString, when i use this it will always use replace on the string...
2
by: zhengfish | last post by:
HI,all I have a class named CCC which have some members of std::string type. I declare a class pointer like this: CCC* ccc = new CCC( xml_input ); then I send the ccc to another module with...
3
by: Alex K. | last post by:
Hi all I need a string type with only three possible values: let's say "A", "B", "C". In other words, I need something like enum but of string type: enum MyStrings { sA = "A", sB = "B", sC...
10
by: =?Utf-8?B?RWxlbmE=?= | last post by:
I am surprised to discover that c# automatically converts an integer to a string when concatenating with the "+" operator. I thought c# was supposed to be very strict about types. Doesn't it seem...
1
by: Mike | last post by:
Hi, I'm passing a JSON-encoded string to json_decode() and am expecting its output to be an object type, but am getting a string type instead. How can I return an object? In the docs, the...
1
by: mathewgk80 | last post by:
Hi all, I would like to convert dataset type to string type... i am using asp.net,c#.net and sql server.. Please help me. Regards, Mathew
1
by: kenneth6 | last post by:
ctype.h: toupper(c), tolower(c): change case of char isalphanum(c), isalpha(c), isdigit(c), ispunct(c), isspace(c), iscntrl(c), islower(c), isupper(c): boolean checks on type of char i know...
1
by: kenneth6 | last post by:
I am writing sth about data in string type in console mode. now, I transform it to Windows Form Application, i know managed type should be used here instead of the unmanaged type. should I change...
2
by: Andy B | last post by:
I have the following listView control on a page: <asp:ListView ID="ListView1" runat="server" ItemPlaceholderID="PlaceHolder1"> <ItemTemplate> <dl> <dt>
6
by: SchoolOfLife | last post by:
Does an object in C++ of std::string type terminates with null character? The charater string literals in C++ (to maintain backward compatibility with C) end with a null character. Is this same with...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.