Click here to Skip to main content
16,008,183 members
Home / Discussions / Database
   

Database

 
QuestionCan't get value from DataSet into variable without explicit casting? Pin
ThomasH122-Jul-04 13:17
ThomasH122-Jul-04 13:17 
GeneralParsing, Processing, And Inserting Multiple Records Into a Database Design Question Pin
Member 66660722-Jul-04 10:47
Member 66660722-Jul-04 10:47 
Generalstore a c# byte array Pin
pelos22-Jul-04 6:38
pelos22-Jul-04 6:38 
GeneralRe: store a c# byte array Pin
partyganger22-Jul-04 17:30
partyganger22-Jul-04 17:30 
GeneralRe: store a c# byte array Pin
pelos22-Jul-04 23:41
pelos22-Jul-04 23:41 
GeneralRe: store a c# byte array Pin
Anonymous23-Jul-04 9:29
Anonymous23-Jul-04 9:29 
GeneralRe: store a c# byte array Pin
partyganger23-Jul-04 9:30
partyganger23-Jul-04 9:30 
Generaldatagrid Pin
viviansm21-Jul-04 21:26
viviansm21-Jul-04 21:26 
I create a frmCustomer that contains of txtCustID, txtCustFName,txtCustLName,txtCustDob and txtCustIC.... and the Add button, Search button and Exit button. When the user click on the Search button, the frmSearch will show. The user can search for the customer by select the alphabet in a combobox. The details of the customer whose last name start with that alphabet will display in the datagrid.

The datagrid in ths frmSearch contains of CustID, CustName, CustDoB. When the user double click on the specific row of the datagrid. The data in the selected row will bind to all the textbox in frmCustomers. Then, the user can do the edit or delete of the record by pressing the button in frmCustomers.

But,i am having a problem that it always get the original datasource instead of the filtered datasource when i double click on the selected row in the datagrid. Please help if you know how to solve this problem.

part of the coding is as follows:

Private Sub btnSearchName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearchName.Click

With Me.DataSet11.Tables("Customers")

'carrier()

With DataGrid1
.CaptionText = "Search by Last Name"
End With

If cboLastName.Text = "ALL" Then
.DefaultView.RowFilter = "CustLName like '%'"
Else
.DefaultView.RowFilter = "CustLName like '" & cboLastName.Text & "%'"
End If

If .DefaultView.Count = 0 Then
MessageBox.Show("Data not found !.", "VideoMate", MessageBoxButtons.OK, MessageBoxIcon.Information)
'Else
'MessageBox.Show("Number of data : " & .DefaultView.Count.ToString(), "VideoMate", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

If BindingContext(Me.DataSet11.Customers).Position < 0 Then
With DataGrid1
.CaptionText = "Database is empty !"
End With
End If

Me.DataGrid1.DataSource = .DefaultView

End With


End Sub


Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick

Dim CM1 As CurrencyManager = CType(Me.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember), CurrencyManager)
If CM1.Position > -1 Then
Me._CM.Position = CM1.Position
Me.Close()
End If

End Sub


Thank youCool | :cool:
GeneralRe: Very Urgent SQL query Pin
ThomasH122-Jul-04 13:20
ThomasH122-Jul-04 13:20 
GeneralRe: Very Urgent SQL query Pin
partyganger22-Jul-04 18:23
partyganger22-Jul-04 18:23 
General&quot;how to install multi database on the same machine using different names from DTS package&quot; Pin
Harmeet Singh21-Jul-04 17:28
Harmeet Singh21-Jul-04 17:28 
GeneralSQL Table Names in the Header Pin
Cedar Sith21-Jul-04 11:55
Cedar Sith21-Jul-04 11:55 
GeneralRe: SQL Table Names in the Header Pin
Bill Dean23-Jul-04 9:14
Bill Dean23-Jul-04 9:14 
GeneralLooking for some code that imports a CSV file using ADO.NET Pin
David Flores21-Jul-04 11:09
David Flores21-Jul-04 11:09 
GeneralSQL Server engine? (packaging) Pin
xstoneheartx21-Jul-04 10:50
xstoneheartx21-Jul-04 10:50 
GeneralRe: SQL Server engine? (packaging) Pin
Anders Molin22-Jul-04 16:09
professionalAnders Molin22-Jul-04 16:09 
GeneralA Challenging SQL Server Puzzle Pin
partt21-Jul-04 6:31
partt21-Jul-04 6:31 
GeneralRe: A Challenging SQL Server Puzzle Pin
Steven Campbell21-Jul-04 7:09
Steven Campbell21-Jul-04 7:09 
GeneralRe: A Challenging SQL Server Puzzle Pin
michanne121-Jul-04 18:22
michanne121-Jul-04 18:22 
GeneralChoosing a new db technology Pin
KMerker21-Jul-04 1:50
KMerker21-Jul-04 1:50 
GeneralRe: Choosing a new db technology Pin
Colin Angus Mackay21-Jul-04 3:37
Colin Angus Mackay21-Jul-04 3:37 
GeneralRe: Choosing a new db technology Pin
darkbyte24-Jul-04 10:38
darkbyte24-Jul-04 10:38 
Generalin-place editing Pin
bora3ee21-Jul-04 1:15
bora3ee21-Jul-04 1:15 
Generalthree doubts :( Pin
xcavin20-Jul-04 2:09
xcavin20-Jul-04 2:09 
GeneralRe: three doubts :( Pin
Michael Potter20-Jul-04 2:55
Michael Potter20-Jul-04 2:55 

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.