Click here to Skip to main content
15,889,116 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Remove Javascript controls from export to excel - VB.Net Pin
Mycroft Holmes25-Jan-10 12:00
professionalMycroft Holmes25-Jan-10 12:00 
GeneralRe: Remove Javascript controls from export to excel - VB.Net Pin
technette25-Jan-10 12:32
technette25-Jan-10 12:32 
QuestionI don't know why I have this error Pin
Curious 200922-Jan-10 5:51
Curious 200922-Jan-10 5:51 
AnswerRe: I don't know why I have this error Pin
DJ Matthews22-Jan-10 6:01
DJ Matthews22-Jan-10 6:01 
GeneralRe: I don't know why I have this error Pin
Curious 200922-Jan-10 6:33
Curious 200922-Jan-10 6:33 
AnswerRe: I don't know why I have this error Pin
loyal ginger22-Jan-10 6:31
loyal ginger22-Jan-10 6:31 
GeneralRe: I don't know why I have this error Pin
Curious 200922-Jan-10 6:39
Curious 200922-Jan-10 6:39 
GeneralRe: I don't know why I have this error Pin
loyal ginger22-Jan-10 7:10
loyal ginger22-Jan-10 7:10 
Since nobody else offers any new ideas, I will post the modified version here, just for your information:
        Dim ra As Integer
        Dim cmd As New SqlCommand

        Dim cnt_del As Integer
        Dim room_N As Integer
        Dim str As String

        con.ConnectionString = strOpen        
        con.Open()

        cmd.Connection = con
        cmd.CommandText = "SELECT * FROM Info"

	'con2 should be declared somewhere
        con2.ConnectionString = strOpen        
        con2.Open()

	'cmd2 should be declared somewhere
        cmd2.Connection = con2
        Dim lrd As SqlDataReader = cmd.ExecuteReader()

        If lrd.HasRows Then

            Try
                'Dim lwr As SqlDataReader

                While lrd.Read()
                    ListBox1.Items.Clear()

                    str = lrd.GetValue(0).ToString() + ","
                    str = str + lrd.GetValue(1).ToString() + ","
                    str = str + lrd.GetValue(2).ToString() + ","
                    str = str + lrd.GetValue(3).ToString() + ","
                    str = str + lrd.GetValue(4).ToString() + ","
                    str = str + lrd.GetValue(5).ToString()+ ","
                    str = str + lrd.GetValue(6).ToString()

                    ListBox1.Items.Insert(cnt_del, str)
                    cnt_del = cnt_del + 1

                    ListBox_Available.Items.Clear()
                    room_N = SearchAvailableRooms(lrd.GetValue(2), lrd.GetValue(3), lrd.GetValue(4), lrd.GetValue(0), lrd.GetValue(1))

                    If room_N > 0 Then
                        cmd.CommandText = "UPDATE Reservations SET AvailRoomsRates = 'Trials'"
                        cmd.ExecuteNonQuery()
                        cmd2.CommandText = "UPDATE Reservations SET AvailRoomsRates = 'Trials'"
                        cmd2.ExecuteNonQuery()
                    End If

                End While

                lrd.Close()


            Catch ex As Exception
                cnt_error = cnt_error + 1
                TextBox_Error.Text = cnt_error.ToString()
            End Try
        End If

        con.Close() 'Whether there is error or not. Close the connection.
	con2.Close()

I really don't know if there is an alternative to this. Sorry!
GeneralRe: I don't know why I have this error Pin
Curious 200922-Jan-10 7:35
Curious 200922-Jan-10 7:35 
GeneralRe: I don't know why I have this error Pin
loyal ginger22-Jan-10 7:44
loyal ginger22-Jan-10 7:44 
GeneralRe: I don't know why I have this error Pin
Curious 200922-Jan-10 8:49
Curious 200922-Jan-10 8:49 
QuestionDatabase record to textboxes Pin
offroaderdan22-Jan-10 5:06
offroaderdan22-Jan-10 5:06 
AnswerRe: Database record to textboxes Pin
Eddy Vluggen23-Jan-10 5:48
professionalEddy Vluggen23-Jan-10 5:48 
QuestionHow can I import table from one database to another thru a from in VB.net Pin
waner michaud22-Jan-10 3:30
waner michaud22-Jan-10 3:30 
AnswerRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen23-Jan-10 5:04
professionalEddy Vluggen23-Jan-10 5:04 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
waner michaud23-Jan-10 7:23
waner michaud23-Jan-10 7:23 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen24-Jan-10 1:36
professionalEddy Vluggen24-Jan-10 1:36 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
waner michaud25-Jan-10 4:12
waner michaud25-Jan-10 4:12 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen25-Jan-10 7:58
professionalEddy Vluggen25-Jan-10 7:58 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
waner michaud25-Jan-10 8:10
waner michaud25-Jan-10 8:10 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen25-Jan-10 8:34
professionalEddy Vluggen25-Jan-10 8:34 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
waner michaud26-Jan-10 6:11
waner michaud26-Jan-10 6:11 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen26-Jan-10 6:24
professionalEddy Vluggen26-Jan-10 6:24 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
waner michaud26-Jan-10 8:21
waner michaud26-Jan-10 8:21 
GeneralRe: How can I import table from one database to another thru a from in VB.net Pin
Eddy Vluggen26-Jan-10 8:35
professionalEddy Vluggen26-Jan-10 8:35 

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.