Click here to Skip to main content
15,868,016 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: convert string to int? Pin
veon cheng19-Jul-09 21:56
veon cheng19-Jul-09 21:56 
GeneralRe: convert string to int? Pin
Dalek Dave19-Jul-09 23:45
professionalDalek Dave19-Jul-09 23:45 
GeneralRe: convert string to int? Pin
veon cheng20-Jul-09 15:47
veon cheng20-Jul-09 15:47 
GeneralClarification Pin
Dalek Dave20-Jul-09 22:09
professionalDalek Dave20-Jul-09 22:09 
GeneralRe: Clarification Pin
veon cheng21-Jul-09 16:42
veon cheng21-Jul-09 16:42 
Questioncode for passing username and password to crystal report? Pin
KIDYA19-Jul-09 18:44
KIDYA19-Jul-09 18:44 
Questionshow all columns from a combo box Pin
Kevin Mitchel19-Jul-09 18:32
Kevin Mitchel19-Jul-09 18:32 
AnswerRe: show all columns from a combo box [modified] Pin
Andy_L_J19-Jul-09 20:09
Andy_L_J19-Jul-09 20:09 
You would use a datagridView...

Create a DataTable to hold the query results:

Dim dt As DataTable = New DataTable("MyTable")


Get the data from the database:

Dim conn as New SqlConnection(connString)
Dim sql as String = "SELECT * FROM SomeTable"
Try
  conn.Open()
  Dim cmd As New SqlCommand(sql,conn)
  Dim da As New SqlDataAdapter(cmd)
  da.Fill(dt)
  conn.Close()
  cmd.Dispose()
Catch ex As Exception
End Try


Assign the DataTable to the DataGridView Control's DataSource property:;

DataGridView1.DataSource = dt


...or something like that.

<edit -="" changed="" datagrid="" to="" datagridview="" cmd="" dt="" in="" sqldataadapter="" initialiser="" too="" many="" vb6="" questions="" around="" here...="">

I don't speak Idiot - please talk slowly and clearly

I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury

Driven to the arms of Heineken by the wife

modified on Monday, July 20, 2009 2:48 AM

QuestionTry and catch ??? Pin
veon cheng19-Jul-09 17:06
veon cheng19-Jul-09 17:06 
AnswerRe: Try and catch ??? Pin
koolprasad200319-Jul-09 21:10
professionalkoolprasad200319-Jul-09 21:10 
GeneralRe: Try and catch ??? Pin
veon cheng20-Jul-09 16:04
veon cheng20-Jul-09 16:04 
GeneralRe: Try and catch ??? Pin
koolprasad200320-Jul-09 18:52
professionalkoolprasad200320-Jul-09 18:52 
QuestionIs there a way to use a radio as joystick through usb? Pin
Sonhospa19-Jul-09 11:27
Sonhospa19-Jul-09 11:27 
AnswerRe: Is there a way to use a radio as joystick through usb? Pin
Christian Graus19-Jul-09 15:16
protectorChristian Graus19-Jul-09 15:16 
NewsRe: Is there a way to use a radio as joystick through usb? Pin
Sonhospa19-Jul-09 20:46
Sonhospa19-Jul-09 20:46 
GeneralRe: Is there a way to use a radio as joystick through usb? Pin
Dave Kreskowiak20-Jul-09 4:09
mveDave Kreskowiak20-Jul-09 4:09 
QuestionSending Email Using Gmail [modified] Pin
Mohammed.Al-Qaisi19-Jul-09 1:09
Mohammed.Al-Qaisi19-Jul-09 1:09 
AnswerRe: Sending Email Using Gmail Pin
Vimalsoft(Pty) Ltd19-Jul-09 20:16
professionalVimalsoft(Pty) Ltd19-Jul-09 20:16 
GeneralRe: Sending Email Using Gmail Pin
Mohammed.Al-Qaisi19-Jul-09 22:22
Mohammed.Al-Qaisi19-Jul-09 22:22 
GeneralRe: Sending Email Using Gmail Pin
Vimalsoft(Pty) Ltd19-Jul-09 22:39
professionalVimalsoft(Pty) Ltd19-Jul-09 22:39 
QuestionAm I getting it right????? Please help!! Pin
ChiSmile18-Jul-09 20:00
ChiSmile18-Jul-09 20:00 
AnswerRe: Am I getting it right????? Please help!! Pin
Dave Kreskowiak20-Jul-09 4:07
mveDave Kreskowiak20-Jul-09 4:07 
QuestionConvert Byte to SByte without errors Pin
DaveyM6918-Jul-09 13:19
professionalDaveyM6918-Jul-09 13:19 
AnswerRe: Convert Byte to SByte without errors Pin
Luc Pattyn18-Jul-09 17:34
sitebuilderLuc Pattyn18-Jul-09 17:34 
GeneralRe: Convert Byte to SByte without errors Pin
DaveyM6918-Jul-09 22:02
professionalDaveyM6918-Jul-09 22:02 

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.