Click here to Skip to main content
15,891,704 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Problem in opening a textfile in excel using vb.net Pin
Dave Kreskowiak19-Mar-08 4:28
mveDave Kreskowiak19-Mar-08 4:28 
Questionhow do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mr Oizo18-Mar-08 21:18
Mr Oizo18-Mar-08 21:18 
AnswerRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mycroft Holmes18-Mar-08 21:52
professionalMycroft Holmes18-Mar-08 21:52 
GeneralRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Mr Oizo18-Mar-08 22:41
Mr Oizo18-Mar-08 22:41 
AnswerRe: how do I determine which button was clicked on a prevoius form to access the form I am currently working on? Pin
Tom Wright19-Mar-08 8:58
Tom Wright19-Mar-08 8:58 
QuestionHow to retrieve the data by Date/Time Data Type from a Table ? Pin
phowarso18-Mar-08 20:07
phowarso18-Mar-08 20:07 
AnswerRe: How to retrieve the data by Date/Time Data Type from a Table ? Pin
Christian Graus18-Mar-08 20:19
protectorChristian Graus18-Mar-08 20:19 
Generalproblem with int32 field and long for dataGrid Pin
AAGTHosting18-Mar-08 17:50
AAGTHosting18-Mar-08 17:50 
I am trying to put some info from the database and datatable into a data grid and I get an error on the phone number fields when trying to display the info in the dataGrid control.

Here is the error I get.

It says it can't store the info in the column. The type is Int 32, expecting Int32.

In the database in this column I am using a bigint in sql server express 2005.

Here is my code.

Dim dt As New DataTable()        
Dim dr As DataRow

For Each row As DataRow In dtStud.Rows            
dr = dt.NewRow()            
dr(0) = row("stud_name")            
dr(1) = row("stud_par_name")            
dr(2) = row("stud_id")            

' get student instruments            
Call studentInstruments(Convert.ToInt32(row("stud_id")))            

' create counter            
Dim intCount As Integer = 1            

For Each row2 As DataRow In dtStudInst.Rows                

 If intCount = 1 Then                    
  strInst = Convert.ToString(row2("less_instrument"))                      
 Else                    
  strInst += ", " & Convert.ToString(row("less_instrument"))                
 End If            
Next            

dr(3) = row("stud_phone")            
dr(4) = row("stud_cell")            
dr(5) = strInst            

dt.Rows.Add(dr)        

Next


Can anyone tell me why it expects int32 when I am using a Long for the data table column.

The error says the following:

Value was either too small or large for an int32. Couldn't store <9098791232>in stud_phone column. Expected type is Int32.


stud_phone is the name of the database field. I get this error on program start up which means it is in sub loadStudentList().

Do you thinkitmight help to convert the vlue from the database to a string?
GeneralRe: problem with int32 field and long for dataGrid Pin
Mycroft Holmes18-Mar-08 21:58
professionalMycroft Holmes18-Mar-08 21:58 
GeneralRe: problem with int32 field and long for dataGrid Pin
Dave Kreskowiak19-Mar-08 1:42
mveDave Kreskowiak19-Mar-08 1:42 
GeneralRe: problem with int32 field and long for dataGrid Pin
AAGTHosting19-Mar-08 7:11
AAGTHosting19-Mar-08 7:11 
GeneralRe: problem with int32 field and long for dataGrid Pin
AAGTHosting19-Mar-08 7:21
AAGTHosting19-Mar-08 7:21 
GeneralSystem.Data.DataRow View Error in Combo Box Pin
AAGTHosting18-Mar-08 17:34
AAGTHosting18-Mar-08 17:34 
GeneralRe: System.Data.DataRow View Error in Combo Box Pin
Mycroft Holmes18-Mar-08 22:00
professionalMycroft Holmes18-Mar-08 22:00 
Generalhelp display time only in vb form from sql dateTime (UDT time) Pin
AAGTHosting18-Mar-08 13:22
AAGTHosting18-Mar-08 13:22 
GeneralRe: help display time only in vb form from sql dateTime (UDT time) Pin
Mycroft Holmes18-Mar-08 22:04
professionalMycroft Holmes18-Mar-08 22:04 
GeneralIOLECommandTarget Interop and Optical Zoom in WebBrowser Control Pin
TerriTop18-Mar-08 12:23
TerriTop18-Mar-08 12:23 
QuestionI have a VB.Net Windows application Pin
indian14318-Mar-08 9:55
indian14318-Mar-08 9:55 
GeneralRe: I have a VB.Net Windows application Pin
AliAmjad18-Mar-08 10:15
AliAmjad18-Mar-08 10:15 
GeneralRe: I have a VB.Net Windows application Pin
Dave Kreskowiak18-Mar-08 10:27
mveDave Kreskowiak18-Mar-08 10:27 
GeneralRe: I have a VB.Net Windows application Pin
Dave Kreskowiak18-Mar-08 10:25
mveDave Kreskowiak18-Mar-08 10:25 
GeneralRe: I have a VB.Net Windows application Pin
indian14318-Mar-08 20:52
indian14318-Mar-08 20:52 
GeneralPublic set in VB 6.0 Pin
leaveu18-Mar-08 9:30
leaveu18-Mar-08 9:30 
AnswerRe: Public set in VB 6.0 Pin
Arjun Marwaha18-Mar-08 21:38
Arjun Marwaha18-Mar-08 21:38 
GeneralRe: Public set in VB 6.0 Pin
Dave Kreskowiak19-Mar-08 1:34
mveDave Kreskowiak19-Mar-08 1:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.