Click here to Skip to main content
11,583,859 members (45,874 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0 VB.NET
Hi to all.

I need some help........
i want to copy my 3 sql files in this 3 works field.

Thanks........

    Private Sub Find_Machine_Customer()
        Dim Work_mst_roller_code As String = ""
        Dim con As OleDbConnection = New OleDbConnection(Main_Form.ConString)
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT mst_roller_last_location, mst_roller_last_supp, mst_roller_type_pipe_id FROM Master_Roller WHERE Master_Roller.mst_roller_id = " & Parm_Roller_Roller, con)
        con.Open()
        work1     
        work2
        work3 
        con.Close()
        con = Nothing
    End Sub
Posted 27-Dec-12 10:49am
Comments
richcb at 27-Dec-12 16:58pm
   
That is not a question. Elaborate and specify a probelm you are having.
Sergey Alexandrovich Kryukov at 27-Dec-12 17:23pm
   
I would also advise to compose a more specific title for your questions. You need right people to pay attention for your post, not the opposite. :-)
—SA
Aarti Meswania at 27-Dec-12 23:43pm
   
do you mean by select record from sql and write in Excel worksheet?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try this

Private Sub Find_Machine_Customer()
        Dim Work_mst_roller_code As String = ""
        Dim con As OleDbConnection = New OleDbConnection(Main_Form.ConString)
	Dim dtbl_main As DataTable = New DataTable
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT mst_roller_last_location, mst_roller_last_supp, mst_roller_type_pipe_id FROM Master_Roller WHERE Master_Roller.mst_roller_id = " & Parm_Roller_Roller, con)
        con.Open()
	Dim adapter1 As OleDbDataAdapter = New OleDbDataAdapter(cmd)
	adapter1.Fill(dtbl_main)
	
        work1 =  dtbl_main.Rows(0)(1).ToString
        work2 = dtbl_main.Rows(0)(2).ToString
        work3  = dtbl_main.Rows(0)(3).ToString
        con.Close()
        con = Nothing
    End Sub
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 430
1 Sergey Alexandrovich Kryukov 314
2 virusstorm 268
3 Richard Deeming 220
4 Dave Kreskowiak 200
0 OriginalGriff 1,623
1 Sergey Alexandrovich Kryukov 1,135
2 Abhinav S 701
3 Dave Kreskowiak 627
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100