Santanu.Das 128

FROM WHICH TABLE YOU ARE GETTING THESE [AMOUNT],[INTEREST],[TERMS], [TotalInterest]. YOU MUST SPECIFY THEM IN FROM CLAUSE.

YOU CAN USE BETWEEN CLAUSE FOR A RANGE OF DATES IN WHERE CLAUSE.
`WHERE (LOANS.RELEASED BETWEEN @d1 and @d2)

Reverend Jim commented: Please stop shouting -3

Santanu.Das 128

your query should be

"insert into SK_Silk (JID,silk_own) Values (("Select JID From TB_User where StrUSerID='" & TextBox1.Text & "'") ," & Val(TextBox2.Text))
Abdelaziz_1 commented: i got error: http://imgur.com/XVXz2Oz +0

Santanu.Das 128

Agreed with Teme64. You can try it.

Reverend Jim commented: Try posting something original instead of trying to get points for someone else's solution. -3

Santanu.Das 128

take the array you declared i.e IntArr() as a dynamic array and do you jobs.
The codes are as like

 'declare the variables
        Dim IntArr() As String
        Dim i As Integer = 0

        'Redimentioning the array
        ReDim IntArr(i)

        For Each tb As Control In Me.Controls
            If TypeOf tb Is TextBox Then
                If Not String.IsNullOrWhiteSpace(tb.Text) Then
                    'redimentioning the array and store the data
                    ReDim Preserve IntArr(i)
                    IntArr(i) = tb.Text
                    i = i + 1
                End If
            End If
        Next

        'Trying to sort the array
        Array.Sort(IntArr)

        'Now time to display data which are stored in array
        i = 0
        Do
            For Each tb As Control In Me.Controls
                If TypeOf tb Is TextBox Then
                    tb.Text = ""
                    If tb.Name = "tbxProp" & (i + 1).ToString Then
                        tb.Text = IntArr(i)
                        Exit For
                    End If
                End If
            Next
            i += 1
        Loop Until i > IntArr.GetUpperBound(0)

I think it can help you.

Santanu.Das 128

This type of performance never needs to edit its profile.
He is really really...............................(nothing match about him).

I am also in dream if any day I can touch him.

Santanu.Das 128

Take a Boolean varable before declaring the for loop.
Your codes Should be like

Dim array as Textbox() = {txt1, txt2, txt3}
'Array of textbox's
Dim match As Boolean = False
For loop = 0 to 3
    If Array(Loop).text = Data_In_Database then
    'Do something
    match = True
    Endif
next

If Not match Then MessageBox.Show("Your Error Message")

Hope it should help you.

Santanu.Das 128

Wrong cods to construct SQL Statement.

For Each row As DataGridViewRow In dataGridView1.Rows
For i As Integer = 0 To dataGridView1.Rows.Count - 124
objComm.CommandText = "SELECT * FROM table1 where Upazila = '" & dataGridView1.SelectedRows(i).Cells(2).Value.ToString() & "'"
Next
Next
Do not understand, why did you use those nested loops.
After completing it always gives you a single row.

waterm commented: yes you are right ,it gives me only single row,but how can i solved this problem,I want to randomly select some rows from gridview and display it to crystal report.plse. help if u can. +0

Santanu.Das 128

I am really very sorry J. C. for my misspelling of the word “Sort”. I am also grateful to you to draw the attention about mistake.
Thank you so much J.C.
At the preface I already wrote that there are too many methods and process to sort an array. You can like and use any one of them. Here, seeing the post in CodeProject, I got an conception and an idea came with me , Why not can I use this conception in vb? I did it as a practice job. And after completion I tried to share this conception with my every DaniWeb friends. This is nothing to grow a conception about sorting an array and also recursion.

Without recursion, it can be done by the use of ‘GoTo’ Statement. I did it, where I declared the Array as Double Type. The snippet is following.

    Private Sub TryToShort(ByVal num() As Double)

        Dim temp As Double
        Dim round As Double = 0.0#
        Dim i As Double = 0

ShortElement:

        If i >= num.GetUpperBound(0) Then
            i = 0
            round += 1
            If round >= num.GetUpperBound(0) Then
                Exit Sub
            End If
        End If

        If num(i) > num(i + 1) Then
            temp = num(i)
            num(i) = num(i + 1)
            num(i + 1) = temp
            i += 1
            GoTo ShortElement
        Else
            i += 1
            GoTo ShortElement
        End If

    End Sub

Here, I try to show, how does 'GoTo' statement work.

Santanu.Das 128

In my project I did it in VB.Net. But I do not know PHP. If you like I can post it, but it is in vb2010. You would convert it in PHP.