Click here to Skip to main content
15,888,579 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to load excel records into oracle table using vb.net Pin
Dave Kreskowiak20-Mar-08 5:10
mveDave Kreskowiak20-Mar-08 5:10 
GeneralSet the width for a dataGrid column Pin
AAGTHosting19-Mar-08 15:25
AAGTHosting19-Mar-08 15:25 
GeneralRe: Set the width for a dataGrid column Pin
Dave Kreskowiak20-Mar-08 5:03
mveDave Kreskowiak20-Mar-08 5:03 
GeneralCan't find column 1 in dataTable that populates dataview then datagrid Pin
AAGTHosting19-Mar-08 11:49
AAGTHosting19-Mar-08 11:49 
GeneralRe: Can't find column 1 in dataTable that populates dataview then datagrid Pin
Dave Kreskowiak19-Mar-08 13:10
mveDave Kreskowiak19-Mar-08 13:10 
GeneralRe: Can't find column 1 in dataTable that populates dataview then datagrid Pin
AAGTHosting19-Mar-08 15:05
AAGTHosting19-Mar-08 15:05 
GeneralRe: Can't find column 1 in dataTable that populates dataview then datagrid Pin
Dave Kreskowiak20-Mar-08 5:01
mveDave Kreskowiak20-Mar-08 5:01 
GeneralRandom records Pin
bapu288919-Mar-08 10:04
bapu288919-Mar-08 10:04 
Hello

I have posted this few days ago, I want to random records form MS access database and according to Christian Graus i have tried this it's working so so but i am still not happy i am still trying it but i dont know what to do now

this was before Christian's rep.
First code

Try<br />
<br />
Me.conTest.ConnectionString = _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= MyTest.mdb"<br />
Catch eConnection As System.Exception<br />
MessageBox.Show(eConnection.Message)<br />
End Try<br />
<br />
'if array size is smaller then increase as per entry<br />
ArraySize = Count<br />
Dim IntegerArray(ArraySize) As Integer<br />
'sort integers<br />
Call SortArray(ArraySize, IntegerArray)<br />
Try<br />
odaTest.Fill(dsTest)<br />
'lblNo.Text = Me.BindingContext(dsTest.MyTest).Position<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
Call dsContacts_PositionChanged()<br />
End If<br />
<br />
this is for array <br />
<br />
Private Sub SortArray(ByVal N As Integer, ByVal SortedArray() As Integer)<br />
'increase the array size according to number of entry <br />
For I As Integer = 0 To N<br />
SortedArray(I) = I<br />
Next I<br />
End Sub

============

and this is after rep.

it's workind ok but i am sure i am doing something wrong but what ?

this is the new code


Try<br />
<br />
                Me.conTest.ConnectionString = _<br />
                  "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= MyTest.mdb"<br />
            Catch eConnection As System.Exception<br />
                MessageBox.Show(eConnection.Message)<br />
            End Try<br />
            Me.conTest.Open()<br />
            Dim MyData As New OleDb.OleDbCommand("SELECT *FROM MyTest ORDER BY ID ", conTest)<br />
            Dim DR As Data.OleDb.OleDbDataReader = MyData.ExecuteReader<br />
            Do While DR.Read = True<br />
                ArraySize += 1<br />
            Loop<br />
            DR.Close()<br />
<br />
            'if array size is smaller then increase as per entry<br />
            Dim IntegerArray(ArraySize) As Integer<br />
            'sort integers<br />
            Call SortArray(ArraySize, IntegerArray)<br />
            ReDim Asked(ArraySize)<br />
            Call dsContacts_PositionChanged()<br />
<br />
Private Sub NavNext()<br />
        If AskedQ >= ArraySize Then<br />
            MessageBox.Show("Finish want to play again..?", "Finish", MessageBoxButtons.OK)<br />
            For I As Integer = 0 To ArraySize<br />
                Asked(I) = False<br />
                AskedQ = 0<br />
            Next<br />
            Exit Sub<br />
        Else<br />
            Try<br />
                Do<br />
                    odaTest.Fill(dsTest)<br />
                    R = CInt(Rnd() * ArraySize)<br />
                    '[Go to the next entry]<br />
                    Me.BindingContext(dsTest, "MyTest").Position = R<br />
                Loop Until Asked(R) = False<br />
                AskedQ += 1<br />
                Asked(R) = True<br />
            Catch eLoad As System.Exception<br />
                MessageBox.Show(eLoad.Message)<br />
            End Try<br />
            '[See custom procedures]<br />
            Me.dsContacts_PositionChanged()<br />
        End If<br />
    End Sub


Sleepy | :zzz:

waiting for your kind rep.

thanks you
GeneralRe: Random records Pin
Christian Graus19-Mar-08 10:42
protectorChristian Graus19-Mar-08 10:42 
QuestionRe: Random records Pin
bapu288919-Mar-08 11:07
bapu288919-Mar-08 11:07 
GeneralRe: Random records Pin
Christian Graus19-Mar-08 22:05
protectorChristian Graus19-Mar-08 22:05 
QuestionRe: Random records Pin
bapu288919-Mar-08 22:51
bapu288919-Mar-08 22:51 
Generalhiding mapped drive Pin
Cory Kimble19-Mar-08 9:41
Cory Kimble19-Mar-08 9:41 
GeneralRe: hiding mapped drive Pin
Dave Kreskowiak19-Mar-08 10:33
mveDave Kreskowiak19-Mar-08 10:33 
GeneralRe: hiding mapped drive Pin
Cory Kimble19-Mar-08 10:51
Cory Kimble19-Mar-08 10:51 
GeneralRe: hiding mapped drive Pin
Dave Kreskowiak19-Mar-08 11:11
mveDave Kreskowiak19-Mar-08 11:11 
GeneralRe: hiding mapped drive Pin
Cory Kimble24-Mar-08 4:37
Cory Kimble24-Mar-08 4:37 
GeneralRe: hiding mapped drive Pin
Dave Kreskowiak24-Mar-08 10:34
mveDave Kreskowiak24-Mar-08 10:34 
GeneralTwo simple questions I think Pin
cstrader23219-Mar-08 9:02
cstrader23219-Mar-08 9:02 
GeneralRe: Two simple questions I think Pin
Smithers-Jones19-Mar-08 9:17
Smithers-Jones19-Mar-08 9:17 
GeneralRe: Two simple questions I think Pin
cstrader23219-Mar-08 9:51
cstrader23219-Mar-08 9:51 
QuestionI hate reportviewer......isn't there something better!?!? Pin
Tom Wright19-Mar-08 8:45
Tom Wright19-Mar-08 8:45 
AnswerRe: I hate reportviewer......isn't there something better!?!? Pin
Dave Kreskowiak19-Mar-08 10:34
mveDave Kreskowiak19-Mar-08 10:34 
GeneralRe: I hate reportviewer......isn't there something better!?!? Pin
Tom Wright20-Mar-08 4:54
Tom Wright20-Mar-08 4:54 
GeneralRe: I hate reportviewer......isn't there something better!?!? Pin
Dave Kreskowiak20-Mar-08 4:59
mveDave Kreskowiak20-Mar-08 4:59 

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.