Pgmer 50 Master Poster Featured Poster
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As  System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        Me.Panel1.Location = e.Location
        

    End Sub
but when user clicks you need to stop moving. else u will not have any option to come out... :)
Pgmer 50 Master Poster Featured Poster

Can you show your code which ur using to bind the records to combo in grid?

Pgmer 50 Master Poster Featured Poster

ok then what you need to do is, in the selected index changed event of Fabric combo you need to filter the records of colr combo.
Get the datasource what u attched to color combo to dataview and use rowfilter on fabric change, and assign that dataview as source to colr combo. hope you get idea

Pgmer 50 Master Poster Featured Poster

you need to initialize the cmdOLEDB using new keyword
like cmdOLEDB=new oledbcommand. And after performing action please dispose the objects like coonection object and coomand object.

Pgmer 50 Master Poster Featured Poster

your already placing the combo on grid and you want to know how to bind records to that combo?

Pgmer 50 Master Poster Featured Poster

Then you need to take the number how much user has purchased , when he clicks on purchase u need to update this table with new value.

Pgmer 50 Master Poster Featured Poster
Private Function ExtractNumbers(ByVal expr As String) As String
        Return String.Join(Nothing, System.Text.RegularExpressions.Regex.Split(expr, "[^\d]"))
    End Function

write this function in ur form and call this it will return only number in string.

Pgmer 50 Master Poster Featured Poster

you need to give more details like are you maintaining the purchase details?
If yes, is there any relationship between these two?
or Once user clicks on purchase update ur stock table with Currentstock-Qtypurchased and get the new values fromm db and bind again.

Pgmer 50 Master Poster Featured Poster

In which column the text is? And can you provide the sample excel file? It should read whaterver is there in excel file.

Pgmer 50 Master Poster Featured Poster

Yes Left join will give the cartesian product. Try using inner join. it all depends on the table structure and their relationship defined as said by debasis.

Pgmer 50 Master Poster Featured Poster
Try
            Dim fBrowse As New OpenFileDialog

            With fBrowse
                .Filter = "Excel files(*.xls)|*.xls|All files (*.*)|*.*"
                .FilterIndex = 1
                .Title = "Import data from Excel file"
            End With
            If fBrowse.ShowDialog() = Windows.Forms.DialogResult.OK Then
                Dim fname As String
                fname = fBrowse.FileName
                Dim MyConnection As System.Data.OleDb.OleDbConnection
                Dim DtSet As System.Data.DataSet
                Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
                MyConnection = New System.Data.OleDb.OleDbConnection _
                ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fname & ";" & "Extended Properties=""Excel 8.0;HDR=NO;IMEX=1""")
                MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from[Sheet1$]", MyConnection)
               


                MyCommand.TableMappings.Add("Table", "TestTable")
                DtSet = New System.Data.DataSet
'' Here is dataset with all the data from Excel file.
                MyCommand.Fill(DtSet)
                MyConnection.Close()
            End If


        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
Pgmer 50 Master Poster Featured Poster

you can use Case statement in comboboxselectedindexchanged event

Pgmer 50 Master Poster Featured Poster

Why cant you give button in form, let the user make selection and click button to show records on form 2. And use the view to filter the records. This is the second thread u opend for same issue. :) try different ways of doing things. If you keep doing the same thing result will be the same.. :)

Pgmer 50 Master Poster Featured Poster

At which line the error comes up ?

Pgmer 50 Master Poster Featured Poster

Nothing wrong.. its working for me. i have tested this code.

Pgmer 50 Master Poster Featured Poster

Class BOM is private? If public then goto desginer of the form and you could see
Friend WithEvents dgv1 As System.Windows.Forms.DataGridView
change to PUBLIC WithEvents dgv1 As System.Windows.Forms.DataGridView
it should work

Pgmer 50 Master Poster Featured Poster

In which line the error is?

Pgmer 50 Master Poster Featured Poster

What you want to identify? Have you given name to each of pic? plz explain

Pgmer 50 Master Poster Featured Poster

In windows application we dont have any viewstate. Probably you could try save in app settings. or data is huge save it in DB

Pgmer 50 Master Poster Featured Poster

Dont know whats wrong. the above code works for me. Probably you only can debug and help urself.

Pgmer 50 Master Poster Featured Poster

you must write that showgrid method and should be public.
Ignore my privious post. Just write below code in form load of form2

' Add below code in form 2

Dim dtSource As DataTable
            dtSource = Form1.DataGridView1.DataSource

            Dim dv As DataView
            dv = dtSource.DefaultView
            dv.RowFilter = "Check = True"
            If Not dv.Count = 0 Then
                DataGridView1.DataSource = dv.ToTable
            End If
Pgmer 50 Master Poster Featured Poster

you need to get the coordinates of mouse pointer and Set the location of panel to that new coordinates

Pgmer 50 Master Poster Featured Poster

Instead you do one thing,
First show up the login form and validate is user is already registered if not show the registration form.

Pgmer 50 Master Poster Featured Poster
'In form write this code where you calling ur form2 to be shown
        Dim objfrm As New Form2
        objfrm.Showgrid(dt)
        objfrm.ShowDialog()
' In form1 write this code
Public Sub Showgrid(ByVal dt As DataTable)
        
       Dim dtref As New DataTable
        dtref = dt
        Dim dv As New DataView
        dv = dtref.DefaultView
        dv.RowFilter = "Check = True"
        If Not dv.Count = 0 Then
            DataGridView1.DataSource = dv.ToTable
        End If
Pgmer 50 Master Poster Featured Poster

I sugest you to go with dataview method which is easy to implement

Pgmer 50 Master Poster Featured Poster

ur passing Row(0) so you will get only first row information.

Pgmer 50 Master Poster Featured Poster

Then please mark this thread as solved

Pgmer 50 Master Poster Featured Poster

Thats what is causing the problem i guess. create checkbox column in form2 aswell and hide it.

Pgmer 50 Master Poster Featured Poster

I checked your way of doing it. It worked fine for me. Please check how you have defined the columns in Form2. Is it same as column 1?

Pgmer 50 Master Poster Featured Poster

Why cant you use dataview as shown in previous post? Let the user select the rows which he/she wants and in button click show the form 2 grid using dataview

Pgmer 50 Master Poster Featured Poster

If ComboBox1.SelectedItem = "Sound 1" Then
you need to set Playsound="ur audio file name not Sound1"

Pgmer 50 Master Poster Featured Poster

What is the problem? What is the above code all about? can you explain?

Pgmer 50 Master Poster Featured Poster

Then please mark this thread as solved.

Pgmer 50 Master Poster Featured Poster

Hi ruby,
Please dont post in Someone else thread. And it is already solved. please open other thread.

Pgmer 50 Master Poster Featured Poster
Public Sub Showgrid(ByVal dt As DataTable)
        Dim dtref As New DataTable
        dtref = dt
        Dim dv As New DataView
        dv = dtref.DefaultView
        dv.RowFilter = "Check = True"
        DataGridView1.DataSource = dv.ToTable
       
    End Sub
here Check is the coulmn name of checkbox i have used. dv will have the filtered list of rows and assign to gridview of form 2. hope this helps u
Pgmer 50 Master Poster Featured Poster

If you are going to show only the rows whoes checkbox is checked then Either u need to get those rows in datatable and pass to the form2 or pass all the rows and then filter and show on form2.

Pgmer 50 Master Poster Featured Poster
Dim objfrm As New Form2
        objfrm.ShowRecords(dt)
        objfrm.ShowDialog()

' In form 2
        Public Sub ShowRecords(ByVal dt As DataTable)
        DataGridView1.DataSource = dt
    End Sub

u need to change this code to handle if u want to show only the selected items in form1 grid

Pgmer 50 Master Poster Featured Poster

Can you post your code of form1 which loads or binds data to grid?

Pgmer 50 Master Poster Featured Poster

In your second form Write public sub which takes datatable or dataset as parameter.
When user selects the rows by checking the checkbox and clicks the button, instanitate the object of form 2 and prepare and pass ur datatable or dataset. And use it to show in form 2.

Pgmer 50 Master Poster Featured Poster

Then where you want to save the records which is used in reports and need to print?

Pgmer 50 Master Poster Featured Poster

Hi Eternal Newbie,
Are you sure we can Declare and assign datarow like what you shown above?

Pgmer 50 Master Poster Featured Poster

Hey Unhnd_exception Thanks. I was not knowing that he is using dropdown list... :)

Pgmer 50 Master Poster Featured Poster

In SQL server you first add column of type boolean.
U wrote code for fetching the vaules from database and bind to gird?

Pgmer 50 Master Poster Featured Poster
Dim dt as new datatable
' Code to add columns to table
        dt.Columns.Add("A", Type.GetType("System.String"))
        dt.Columns.Add("B", Type.GetType("System.String"))
        dt.Columns.Add("C", Type.GetType("System.String"))
'Binding the rows to gridview
        DataGridView1.DataSource = dt
' Code to add new row
        Dim dr As DataRow
        dr = dt.NewRow
        dt.Rows.Add(dr)
Pgmer 50 Master Poster Featured Poster

Clearing all the rows and binding the grid again with new set of data?

Pgmer 50 Master Poster Featured Poster

you need to add one more column to table Print as boolean and When user selects or unselects the data from Gridview u need to update those columns in DB and Get the data where Print=1 in crystal report.

Pgmer 50 Master Poster Featured Poster

Ok then somewhere you have made the combobox1.selectedindex=1.
Check your code

Pgmer 50 Master Poster Featured Poster

If you run ur Query before cmd.ExecuteReader() on SQL server are u getting any data?

Pgmer 50 Master Poster Featured Poster

For this u need to write procedure to delete row from db or SQlL statement by passing the condition to delete. And load the new set of data and bind back to grid.

Pgmer 50 Master Poster Featured Poster

In form load event
ComboBox1.Text = "Select item"