hello I have read this site for sorting DATAGRIDVIEW
http://vb.net-informations.com/datagridview/vb.net_datagridview_sort.htm[
^]
and had my code that is like this:
Public conmainWin As String = "user=SYSDBA;password=masterkey;DataBase=C:\My_Database\CLIENT_CUSTOMER.FDB; datasource=localhost;Port=3050;Dialect=3;Charset=ASCII;Role=SA;Connection Lifetime=0;Connection timeout=15;pooling=true;packet size=8192;server type=0"
Public fbcon As New FbConnection
Public fbcmd As FbCommand
Public fbdr As FbDataReader
Public sql As String
Public Sub DBAddUpdate(ByVal sqlAddUpd As String)
Try
fbcon = New FbConnection(conmainWin)
fbcon.Open()
sql = sqlAddUpd
fbcmd = New FbCommand(sql, fbcon)
fbcmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Sub DBClose()
fbcon.Close()
fbcon.Dispose()
End Sub
and my button for sorting datagridview:
Try
Call DBAddUpdate("SELECT * FROM UNPAID_FORM")
DBClose()
Dim fireBirdCon As New FbConnection
fireBirdCon = New FbConnection(conmainWin)
Dim firebirdAdap As New FbDataAdapter(sql, fireBirdCon)
Dim FBds As New gflSOADataSet
fireBirdCon.Open()
firebirdAdap.Fill(FBds, "UNPAID_FORM")
fireBirdCon.Close()
Dim dataVw As New DataView
dataVw = New DataView(FBds.Tables(1), "PARTICULARS > 19", "PARTICULARS ASC", DataViewRowState.CurrentRows)
UNPAID_FORMDataGridView.DataSource = dataVw
MsgBox("Item sorted.", MsgBoxStyle.Information Or MsgBoxStyle.OkOnly, "Information Retrieved")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error!")
End Try
but had exception error that goes like this: Cannot find column [PARTICULARS] in code line
dataVw = New DataView(FBds.Tables(1), "PARTICULARS > 19", "PARTICULARS ASC", DataViewRowState.CurrentRows)
my first column is named PARTICULARS -varchar(35) that has record that goes like this"
'2 of 20% item'
'1 of 20% item'
'7 of 20% item'
'3 of 20% item'
.
.
.
that i wanted to sort in a natural way. Please help me..
makoy03