Problems with string values in datagrid

alwaysinneed

New member
Joined
Dec 7, 2011
Messages
3
Programming Experience
3-5
so i am more experienced with C++ and C# and i am trying to write code in VB.net. that aside... i am creating a form that has keyboard entry into a datagrid. then upon a button event the datagrid has certain columns read into a function and then another column is wrote on. sounds simple enough, but then i am getting an error that is saying that it cannot cast a string to an integer whenever i am trying to pull the string values from the location and assign them to a variable. all my variables are declared as strings so why am i getting this error. is it in the way that i am reading from the datagrid? i am tryig to use the methods from the bindingsource to navigate and then i am just reading the column according to what row i am on.
 
You're getting that error because, at some point, you are trying to use a String where an Integer is expected and that String does not contain a value that can be converted to an Integer. More than that we cannot tell you because you have cleverly kept your source code a secret from us. If we can see what you're doing then we can likely see what you're doing wrong. Post the relevant code and tell us what line the error occurs on. The really clever folks would tell us what data values are being used at the time too.
 
Back
Top