Click here to Skip to main content
15,890,123 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: With just the name of a RadioButton, how can I check/uncheck the control? Pin
Luc Pattyn19-Mar-10 10:30
sitebuilderLuc Pattyn19-Mar-10 10:30 
GeneralRe: With just the name of a RadioButton, how can I check/uncheck the control? Pin
Steve van Niman19-Mar-10 10:58
Steve van Niman19-Mar-10 10:58 
GeneralRe: With just the name of a RadioButton, how can I check/uncheck the control? Pin
Luc Pattyn19-Mar-10 11:04
sitebuilderLuc Pattyn19-Mar-10 11:04 
QuestionDetermining host operating system using VB 6 Pin
elizas19-Mar-10 2:01
elizas19-Mar-10 2:01 
AnswerRe: Determining host operating system using VB 6 Pin
The Man from U.N.C.L.E.19-Mar-10 2:30
The Man from U.N.C.L.E.19-Mar-10 2:30 
AnswerRe: Determining host operating system using VB 6 Pin
Dave Kreskowiak19-Mar-10 2:44
mveDave Kreskowiak19-Mar-10 2:44 
AnswerRe: Determining host operating system using VB 6 Pin
Joao_Machado19-Mar-10 7:59
Joao_Machado19-Mar-10 7:59 
Questionruntime error using new [modified] ....resolved Pin
Daniel Engelkes18-Mar-10 6:43
Daniel Engelkes18-Mar-10 6:43 
each time I run the follow code I get a runtime error.


Public Class menuitems
    Public menuitem As String
    Public itemcost As Double

End Class
'Dim totalorderquantity(12) as Integer
Public Class frmtodayscafe
    Inherits System.Windows.Forms.Form

    Public dr As DataRow
    Public item() As menuitems




    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim fileNamex As String = "menu1.txt"
        Dim dirName As String = _
                    Path.GetDirectoryName(Application.ExecutablePath)
        Dim dt As DataTable
        Dim adapter1 As New OleDbDataAdapter

        Using cn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;" & _
                    "Data Source=" & dirName & ";" & _
                    "Extended Properties=""Text;HDR=Yes;FMT=Delimited""")
            ' Open the connection
            cn.Open()

            ' Set up the adapter
            Using adapter As New OleDbDataAdapter( _
                    "SELECT * FROM " & fileNamex, cn)
                dt = New DataTable("menuitems")
                adapter.Fill(dt)

            End Using

        End Using
        
        Redim item(dt.Rows.Count() - 1)

        Dim drcounter As Integer = 0
        For Each  dr As datarow In dt.Rows
            Debug.Print("{0}    {1}", _
                        dr("Menu Items"), _
                        dr("Item Cost"))
            item(drcounter).menuitem = dr("Menu Items").ToString
            item(drcounter).itemcost = dr("Item Cost").ToString
            drcounter += 1
        Next



the run time error is Object reference not set to an instance of an object.
modified on Friday, March 19, 2010 6:50 PM

AnswerRe: runtime error using new Pin
William Winner18-Mar-10 7:13
William Winner18-Mar-10 7:13 
GeneralRe: runtime error using new Pin
Daniel Engelkes18-Mar-10 7:57
Daniel Engelkes18-Mar-10 7:57 
GeneralRe: runtime error using new Pin
William Winner18-Mar-10 8:03
William Winner18-Mar-10 8:03 
AnswerRe: runtime error using new Pin
Luc Pattyn18-Mar-10 7:39
sitebuilderLuc Pattyn18-Mar-10 7:39 
GeneralRe: runtime error using new Pin
Daniel Engelkes18-Mar-10 7:56
Daniel Engelkes18-Mar-10 7:56 
QuestionPrivilege escalation in VB6 and VB.net programatically Pin
QuickBooksDev18-Mar-10 2:43
QuickBooksDev18-Mar-10 2:43 
AnswerRe: Privilege escalation in VB6 and VB.net programatically Pin
Dave Kreskowiak18-Mar-10 3:42
mveDave Kreskowiak18-Mar-10 3:42 
RantPrivilege Pin
εїзεїзεїз18-Mar-10 8:40
εїзεїзεїз18-Mar-10 8:40 
AnswerRe: Privilege escalation in VB6 and VB.net programatically Pin
kilkfoe119-Mar-10 7:17
kilkfoe119-Mar-10 7:17 
QuestionAdding a new row to DataSource [modified] Pin
Floodlight17-Mar-10 14:05
Floodlight17-Mar-10 14:05 
AnswerRe: Adding a new row to DataSource Pin
Anubhava Dimri17-Mar-10 18:42
Anubhava Dimri17-Mar-10 18:42 
GeneralRe: Adding a new row to DataSource Pin
Floodlight17-Mar-10 19:06
Floodlight17-Mar-10 19:06 
GeneralRe: Adding a new row to DataSource Pin
Anubhava Dimri17-Mar-10 19:38
Anubhava Dimri17-Mar-10 19:38 
AnswerRe: Adding a new row to DataSource Pin
Dave Kreskowiak18-Mar-10 3:49
mveDave Kreskowiak18-Mar-10 3:49 
GeneralRe: Adding a new row to DataSource Pin
Floodlight18-Mar-10 12:40
Floodlight18-Mar-10 12:40 
QuestionMultiThreading in TabPages! Pin
dotnetme217-Mar-10 9:16
dotnetme217-Mar-10 9:16 
Answerpartial answer Pin
Luc Pattyn17-Mar-10 9:51
sitebuilderLuc Pattyn17-Mar-10 9:51 

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.