manal 27 Junior Poster

is it solved ? or you still have problem :S

Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim varConnection As New SqlConnection
Dim varDataSet As New DataSet
Dim varAdapter As SqlDataAdapter
Dim varCommand As SqlCommand
Dim varchar As SqlDataAdapter
Dim sql As String
Dim Record_num = 0 ' you do not need this here
Dim Number_of_Rows As Integer = 0 'why zero? this will hold number of rows in your table so you will be sure that once you reached last record you will not increment it
varConnection = New SqlConnection("Server=(local);user id=sa;password=;Initial Catalog=ROP1")


sql = "SELECT * FROM tbl_rop"

sql = "SELECT distinct * FROM tbl_rop"

varCommand = New SqlCommand(varQuery, varConnection)

varCommand = New SqlCommand(sql, varConnection)
varAdapter = New SqlDataAdapter(varCommand)

varAdapter.Fill(varDataSet) 'used to get the count of number of rows in a table

Number_of_Rows=varDataSet .Tables("your_table_name").Rows.Count

If Record_num <> Number_of_Rows - 1 Then
Record_num = +1
TextBox1.Text = varDataSet.Tables(0).Rows(Record_num).Item("Name_User")
TextBox2.Text = varDataSet.Tables(0).Rows(Record_num).Item("Date_of_birth")
TextBox3.Text = varDataSet.Tables(0).Rows(Record_num).Item("Hobbies")
TextBox4.Text = varDataSet.Tables(0).Rows(Record_num).Item("Phone_number")


End If

gabanxx commented: really helpfull +1
manal 27 Junior Poster

For i = 0 To fLen1 - 1
snglRead1(i) = br1.ReadSingle() 'EXCEPTION thrown right here
Next

maybe you trying to read while you reached the end of file ,

fLen1 = f1.Length

i think this return length on byte , try this

fLen1 = Int(f1.Length / 4)
Nick Evan commented: good catch +3
manal 27 Junior Poster

manal is my real name :)

iamthwee commented: Your parents shuda dropped the 'm' - it would have been more appropriate. +13
ndeniche commented: lol +3
arjunsasidharan commented: iamthwee is a rotten a** +3
manal 27 Junior Poster

according to this link DidWork is integer variable

Dim DidWork As Integer = openFD.ShowDialog()

so in this line

If DidWork <> DialogResult.Cancel Then

u make sure that user did not choose cancel button in OpenFileDialog

i hope thats help u :)

arjunsasidharan commented: +rep +3
manal 27 Junior Poster
strRevText = array.Reverse    'Here is my problem

thats becouse array.Reverse needs an argument and the other thing it does not produce value so you can't assign it to strRevText

strRevText = Me.lblResult.Text

here is problem too , here u do not show the result !

after the correction this is ur code

Dim strOrgText As String
        Dim strRevText As [Char]()
        Dim array As Array

        strOrgText = Me.txtTheString.Text
        strRevText = strOrgText.ToCharArray
        [B]array.Reverse(strRevText)   
        Me.lblResult.Text = strRevText[/B]

or u can use StrReverse function like this

Me.lblResult.Text = StrReverse(Me.txtTheString.Text)
hoosier23 commented: works +1