|
-
Sep 9th, 2004, 09:21 AM
#1
Thread Starter
New Member
select query
Code:
Dim sqlstring As String = "SELECT codeprod,descr,TIMH FROM products where codeklados like '" & editklados.Text.ToString & "'"
Hi there..
i have the following problem
i have a master/detail form with orders and products.
my problem is that i have a combobox at master records that i choose what king of order it is (cars,motorbikes etc) and i want in the comboboxcolumn in the detail datagrid to show me only the products that belongs to the that kind of order. the code that i wrote you works (i think!!!) but as i can see, when i go to the next order i have to requery the selection
Private Sub orders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
'Attempt to load the dataset.
Me.LoadDataSet()
Catch eLoad As System.Exception
'Add your error handling code here.
'Display error message, if any.
System.Windows.Forms.MessageBox.Show(eLoad.Message)
End Try
Me.objorderwithdetails_PositionChanged()
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""C:\products\products.mdb"";Jet OLEDB atabase Password=")
conn.Open()
Dim ds As New DataSet
' select the products based on klados of order
Dim sqlstring As String = "SELECT codeprod,descr,TIMH FROM products where codeklados like '" & editklados.Text.ToString & "'"
dataAdapter = New OleDbDataAdapter(sqlstring, conn)
dataAdapter.Fill(ds, "productlist")
conn.Close()
Dim ComboTextCol As New DataGridComboBoxColumn
With ComboTextCol
.MappingName = "codeproduct"
.NullText = 0
.HeaderText = "ÐåñéãñáöÞ Ðñïúüíôïò"
.Width = 300
.ColumnComboBox.BackColor = BackColor.CornflowerBlue()
.ColumnComboBox.DataSource = ds.Tables("productList").DefaultView
.ColumnComboBox.DisplayMember = "descr"
.ColumnComboBox.ValueMember = "codeprod"
tablestyle.PreferredRowHeight = .ColumnComboBox.Height
tablestyle.GridColumnStyles.Add(ComboTextCol)
End With
End Sub
Last edited by merovatis; Sep 10th, 2004 at 09:57 AM.
-
Sep 10th, 2004, 07:28 AM
#2
Junior Member
Hi,
Can u expain the problem in more details...........are u fetching all the records and using Datarelation object as datasource for ur Detail Grid? or just simply fetching the Details for Each Selected Orders...?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|