Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > อยากให้โค้ดเงือนไข Combobox 2 อันดึงจากฐานข้อมูล MS Access



 

อยากให้โค้ดเงือนไข Combobox 2 อันดึงจากฐานข้อมูล MS Access

 



Topic : 114291



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



อยากได้โค้ดที่ทำให้ Combobox 2 อันนี้Linkกันโดยดึงจากตางราง2ตางราง
ประเภทเวชภัณฑ์ ตารางที่ 1 ชื่อเวชภัณฑ์และวัสดุตารางที่ 2 ถ้าเลือกประเภทเวชภัณฑ์ ก็ให้แสดงเฉพาะชื่อเวชภัณฑ์ของประเภทที่เลือก ทำได้ไหมครับ ช่วยผมหน่อยครับโปรเจคต้องส่งอาจารย์อีก 5 วันแล้วครับ

อยากได้แบบนี้



Tag : .NET, Ms Access, VB.NET, VS 2012 (.NET 4.x), Windows







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-02-09 02:12:46 By : souyofnewerth View : 2120 Reply : 31
 

 

No. 1



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

http://csharp.net-informations.com/dataset/dataset-combobox.htm
http://stackoverflow.com/questions/14237639/how-to-populate-a-combobox-from-a-access-dataset-database
http://stackoverflow.com/questions/16313503/bind-combobox-with-access-table


https://www.google.co.th/search?q=C%23+combobox+binding+access&biw=1280&bih=913&source=lnms&sa=X&ei=hxTYVJeCEJO-uASv64AY&ved=0CAUQ_AUoAA&dpr=1








ประวัติการแก้ไข
2015-02-09 09:02:59
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 09:01:21 By : lamaka.tor
 


 

No. 2



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ถ้าเป็น Windows App ง่ายมากครับ ดับเบิ้ลคลิกที่ Combobox ตัวแรก แล้วสร้าง Event ได้เลยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 09:42:54 By : mr.win
 

 

No. 3



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

แต่อยากได้แบบVB.Net ครับต้องทำโปรเจคจบช่วยหน่อยครับจนปัญญาจริงๆครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 11:09:37 By : souyofnewerth
 


 

No. 4



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

แค่ใช้ where เองนิครับ
แล้วอีกอย่างค้นหาใน google ก็มีออกเกลื่อนไป

1. SQL where
2. combobox binding vb.net

หลักการบ้านๆคือ ให้มัน refresh ผ่าน SQL where ทุกครั้งที่เลือกข้อมูลจาก combobox แค่นั้นเองครับ
ยิ่งถ้าใช้ datasource ยิ่งง่ายใหญ่เลยครับ
แค่ลากมาวาง binding มันก้มาแระ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 12:09:46 By : lamaka.tor
 


 

No. 5



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

อยากได้โค้ดดตัวอย่างอ่าครับ พอจะเขียนให้ได้ไหมครับ
ผมใช้Refreshไม่เป็นด้วยอ่าครับ


ประวัติการแก้ไข
2015-02-09 15:09:30
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 12:20:15 By : souyofnewerth
 


 

No. 6



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

http://www.w3schools.com/sql/sql_where.asp
http://stackoverflow.com/questions/18541474/vb-net-bind-a-combobox-to-a-datasource
http://vb.net-informations.com/dataset/bind-combobox.htm
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 16:01:24 By : lamaka.tor
 


 

No. 7



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ผมไม่เข้าใจจริง ๆ ครับ เขียนโค้ดตัวอย่างให้ดูเถอะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 16:44:13 By : souyofnewerth
 


 

No. 8



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ที่ให้ไปไม่ใช่โค๊ดเรอะครับ

เอางี้ครับเอาโค๊ดล่าสุดมาดูครับ
เด๋วจะแนะวิธีแบบบ้านๆให้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 17:56:24 By : lamaka.tor
 


 

No. 9



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

Code (VB.NET)
 Private Sub Showcombotypedurg()
        Connectiondata()
        sb = New StringBuilder
        sb.Append("SELECT id_typedrug,n_typedrug FROM typedrug")
        sb.Append("SELECT id_drug,n_drug FROM inventory")
        Dim sqlIni As String = sb.ToString()

        com = New OleDbCommand()
        With com
            .CommandText = sqlIni
            .CommandType = CommandType.Text
            .Connection = Conn
            dr = .ExecuteReader()
        End With

        If dr.HasRows Then
            Dim dtCategories As DataTable
            dtCategories = New DataTable()
            dtCategories.Load(dr)

            With chbntypedrug
                .BeginUpdate()
                .DisplayMember = "n_typedrug"
                .ValueMember = "id_typedrug"
                .DataSource = dtCategories
                .EndUpdate()
            End With

            Dim dtShippers As DataTable
            dtShippers = New DataTable()
            dtShippers.Load(dr)

            With chbndrug
                .BeginUpdate()
                .DisplayMember = "n_drug"
                .ValueMember = "id_drug"
                .DataSource = dtShippers
                .EndUpdate()
            End With
        End If
        dr.Close()

dr = .ExecuteReader() เออเร่อบรรทัดที่13ขึ้นว่า Syntax error in FROM clause.


ประวัติการแก้ไข
2015-02-09 19:34:03
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-09 19:33:23 By : souyofnewerth
 


 

No. 10



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 9 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-09 19:33:23
รายละเอียดของการตอบ ::
การเขียนโปรแกรมที่ดีควรจะมีขั้นตอนเช็ค Err เป็นระยะๆครับ

ลอง messebox CommandText
With com
.CommandText = sqlIni
MessageBox.Show( .CommandText )
.CommandType = CommandType.Text
.Connection = Conn
dr = .ExecuteReader()
End With

ลอง messebox CommandText มาเด๋วก็อ๋อเองครับ
ดูท่าทางใช้ SQL เป็นพอสมควร
งั้นแนะอีกนิดครับ

ถ้าจะให้ได้ตามที่ต้องการยังขาด select .... where ไป
การ binding จะมี 2 รอบ คือ
1. รอบแรก เพื่อให้เห็นข้อมูลทั้งหมด ตัวนี้ไม่ต้องมี where
2. รอบที่มีการเลือก dtCategories ก็จะมี select .... where เป็นเงื่อนไข


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 09:06:39 By : lamaka.tor
 


 

No. 11



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ครับผมจะลองดูช่วงเย็นๆ ตอนนี้ไปเรียนครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 09:09:23 By : souyofnewerth
 


 

No. 12



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 11 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-10 09:09:23
รายละเอียดของการตอบ ::
แหล่มครับ สู้ๆ ผมมั่นใจว่าคุณทำได้


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 09:12:59 By : lamaka.tor
 


 

No. 13



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ผมยังติดอีกอีกหลายจุด อีก2วันต้องส่งแล้วด้วย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 09:15:12 By : souyofnewerth
 


 

No. 14



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

https://drive.google.com/file/d/0B-JZ2hYujzUAS2RHT3dPcVhTd0U/view?usp=sharing

Code (VB.NET)
Public Class Form3
    Dim cnn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\PostCode.mdb;Persist Security Info=True;Jet OLEDB:Database Password=4410210091"
    Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        
        ComboBox1.DataSource = GetTableOLEDB("SELECT * FROM Sett_Post_Province", cnn)
        ComboBox2.DataSource = GetTableOLEDB("SELECT * FROM Sett_Post_PostCode", cnn)
    End Sub
    Private Function GetTableOLEDB(SQL As String, strConn As String) As Data.DataTable
        Dim conn As New Data.OleDb.OleDbConnection(strConn)
        Dim ds As New System.Data.DataSet()
        conn.Open()
        Dim strQuery As String = SQL
        Dim adapter As New Data.OleDb.OleDbDataAdapter(strQuery, conn)
        adapter.Fill(ds)
        Return ds.Tables(0)
    End Function

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        ComboBox2.DataSource = GetTableOLEDB("SELECT * FROM Sett_Post_PostCode where Pnv = " & ComboBox1.SelectedValue, cnn)
    End Sub
End Class


บ้านๆ สั้นๆ ไม่ซับซ้อน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 10:16:13 By : lamaka.tor
 


 

No. 15



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ขอบคุณมากครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 10:27:52 By : souyofnewerth
 


 

No. 16



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

Code (VB.NET)
 Private Sub CheckAnimal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        chbntypedrug.DataSource = GetTableOLEDB("SELECT * FROM typedrug", cnn)
        chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory", cnn)
end sub
Private Function GetTableOLEDB(SQL As String, strConn As String) As Data.DataTable

        Dim conn As New Data.OleDb.OleDbConnection(strConn)

        Dim ds As New System.Data.DataSet()

        conn.Open()

        Dim strQuery As String = SQL
        Dim adapter As New Data.OleDb.OleDbDataAdapter(strQuery, conn)

        adapter.Fill(ds)

        Return ds.Tables(0)

    End Function
 Private Sub chbntypedrug_SelectedIndexChanged(sender As Object, e As EventArgs) Handles chbntypedrug.SelectedIndexChanged
        chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory where n_drug= " & chbndrug.SelectedValue, cnn)
    End Sub

adapter.Fill(ds) เออเร่อครับ Syntax error (missing operator) in query expression 'n_drug='.
นี่ไฟล์ฐานข้อมูลของผม https://www.dropbox.com/s/zddc73no00z6szi/Hospital.accdb?dl=0


ประวัติการแก้ไข
2015-02-10 11:30:39
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 11:21:30 By : souyofnewerth
 


 

No. 17



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

"SELECT * FROM inventory where n_drug= "
น่าจะเป็น id_drug รึป่าวครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 11:30:16 By : lamaka.tor
 


 

No. 18



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

เปลี่ยนแล้วก็Errorเหมือนเดิมครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 15:24:15 By : souyofnewerth
 


 

No. 19



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

MessageBox.Show( chbndrug.SelectedValue )
ดูดีๆ
แล้วจะพบทางสว่างครับ

ถ้าไม่พบเด๋วผมจะบอกอีกที
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 15:47:29 By : lamaka.tor
 


 

No. 20



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

Code (VB.NET)
Private Sub showcbdrug()
        da = New OleDbDataAdapter("SELECT DISTINCT n_typedrug From inventory Order By n_typedrug", Conn)
        da.Fill(ds)
        Conn.Close()

        chbntypedrug.DataSource = ds.Tables(0)
        chbntypedrug.DisplayMember = "n_typedrug"
        chbntypedrug.ValueMember = "n_typedrug"
        chbntypedrug.SelectedIndex = -1
    End Sub
    Private Sub chbntypedrug_SelectedIndexChanged(sender As Object, e As EventArgs) Handles chbntypedrug.SelectedIndexChanged
        If chbntypedrug.SelectedIndex > -1 Then
            da = New OleDbDataAdapter("SELECT DISTINCT n_drug From inventory WHERE n_typedrug='" + chbntypedrug.SelectedValue.ToString() + "'", Conn)
            da.Fill(ds)
            Conn.Close()
            chbndrug.DataSource = ds.Tables(0)
            chbndrug.DisplayMember = "n_drug"
            chbndrug.ValueMember = "n_drug"
        End If
    End Sub

ได้วิธีใหม่ละครับ แต่พอเลือกอันแรกอันหลังก็ขึ้นว่างแต่มันมีข้อมูล
ด
ด
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 16:28:48 By : souyofnewerth
 


 

No. 21



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

อยากได้โค้ดที่เลือกห้องรักษาแล้วให้โชว์เฉพาะห้องรักษานั้น ๆ มีไหมครับ
f
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 16:32:51 By : souyofnewerth
 


 

No. 22



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 20 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-10 16:28:48
รายละเอียดของการตอบ ::
ต้องดูใน database ว่ามีค่างว่างรึป่าว
ตอบความคิดเห็นที่ : 21 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-10 16:32:51
รายละเอียดของการตอบ ::
ใช้หลักการเดียวกัน
ส่วน datagrid ก็แค่

DataGridView1.DataSource = GetTableOLEDB("Select * form .... where roomID = " & cmb.SelectedValue)
..
แล้วก็จัดหน้า DataGridView

เป็นอันเส็จพิธี



ความจริง Code (VB.NET)
Private Sub showcbdrug()
        da = New OleDbDataAdapter("SELECT DISTINCT n_typedrug From inventory Order By n_typedrug", Conn)
        da.Fill(ds)
        Conn.Close()

        chbntypedrug.DataSource = ds.Tables(0)
        chbntypedrug.DisplayMember = "n_typedrug"
        chbntypedrug.ValueMember = "n_typedrug"
        chbntypedrug.SelectedIndex = -1
    End Sub
    Private Sub chbntypedrug_SelectedIndexChanged(sender As Object, e As EventArgs) Handles chbntypedrug.SelectedIndexChanged
        If chbntypedrug.SelectedIndex > -1 Then
            da = New OleDbDataAdapter("SELECT DISTINCT n_drug From inventory WHERE n_typedrug='" + chbntypedrug.SelectedValue.ToString() + "'", Conn)
            da.Fill(ds)
            Conn.Close()
            chbndrug.DataSource = ds.Tables(0)
            chbndrug.DisplayMember = "n_drug"
            chbndrug.ValueMember = "n_drug"
        End If
    End Sub


ไม่จำเป็นต้องเขียนยาวขนาดนั้น
แค่แก้ตรง n_typedrug (อย่างที่บอกครับ คุณจะต้องพบทางสว่าง )
Code (VB.NET)
Private Sub CheckAnimal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        chbntypedrug.DataSource = GetTableOLEDB("SELECT * FROM typedrug", cnn)
        chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory", cnn)
end sub
Private Function GetTableOLEDB(SQL As String, strConn As String) As Data.DataTable

        Dim conn As New Data.OleDb.OleDbConnection(strConn)

        Dim ds As New System.Data.DataSet()

        conn.Open()

        Dim strQuery As String = SQL
        Dim adapter As New Data.OleDb.OleDbDataAdapter(strQuery, conn)

        adapter.Fill(ds)

        Return ds.Tables(0)

    End Function
 Private Sub chbntypedrug_SelectedIndexChanged(sender As Object, e As EventArgs) Handles chbntypedrug.SelectedIndexChanged
        chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory where n_typedrug= " & chbndrug.SelectedValue, cnn)
    End Sub

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 16:54:38 By : lamaka.tor
 


 

No. 23



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ในDataBaseไม่มีค่าว่าง

Code (VB.NET)
Private Sub chbntypedrug_SelectedIndexChanged(sender As Object, e As EventArgs) Handles chbntypedrug.SelectedIndexChanged
        chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory where n_typedrug='" & CStr(chbndrug.SelectedValue) & ")'", cnn)
    End Sub


แก้แล้วขึ้นแบบนี้ครับ

ด

ด

พอคลิกเลือกไปเลือกมาก็เขึ้น เออเร่อ ตรง บันทัดที่ 2 Operator '&' is not defined for string "SELECT * FROM inventory where n_" and type 'DataRowView'.


ประวัติการแก้ไข
2015-02-10 17:06:26
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 17:06:02 By : souyofnewerth
 


 

No. 24



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ก
Code (VB.NET)
 Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
        Dim i As Integer
        Dim sqlSale As String = ""
        Dim comTmp As OleDbCommand = New OleDbCommand
        'Dim drTmp As OleDbDataReader
        Dim comsale As OleDbCommand = New OleDbCommand
        For i = 0 To ListView1.Items.Count - 1
            da = New OleDbDataAdapter("INSERT INTO drug(id_order,n_emp,id_drug,n_drug,price_drug,num_drug) VALUES ('" & txtidorder.Text & "'," & chbnemp.Text & "," & CStr(ListView1.Items(i).SubItems(0).Text) & "," & CStr(ListView1.Items(i).SubItems(1).Text) & "," & CInt(ListView1.Items(i).SubItems(3).Text) & "," & CInt(ListView1.Items(i).SubItems(2).Text) & ")", Conn)
            Dim tmpqtybook As Integer
            Dim codedrug As String
            codedrug = ListView1.Items(i).SubItems(0).Text
            sqlSale = "SELECT id_drug,qty FROM inventory Where id_drug ='" & codedrug & "'"
            da = New OleDbDataAdapter(sqlSale, Conn)
            da.Fill(ds, "Pay")
            tmpqtybook = CInt(ds.Tables("Pay").Rows(0).Item("qty"))
            ds.Tables("Pay").Clear()
            sqlSale = "UPDATE inventory"
            sqlSale &= " Set qty = " & tmpqtybook - CInt(ListView1.Items(i).SubItems(2).Text)
            sqlSale &= " where id_drug = '" & codedrug & "'"
            With comsale
                .CommandText = sqlSale
                .ExecuteNonQuery()
            End With
        Next
        MessageBox.Show("บันทึกการส่งจ่ายเรียบร้อยแล้ว", "การสั่งจ่ายเวชภัณฑ์และวัสดุ", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub

หมดปัญญาแก้แล้วจริง ๆ ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-10 22:51:29 By : souyofnewerth
 


 

No. 25



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

มันแค่เขียนผิดครับ
ลอง messebox strQuery ออกมาดูครับแล้วจะเห็นทางกระจ่าง

ปล. chbndrug.SelectedValue มันเป็น string อยู่แล้ว

วิธีจัดระเบียบการการเขียนโปรแกรมคือ
1. ดักจับ Err บ่อยๆ เช่น messebox ค่าที่คิดว่าผิด
2. ดูความซ้ำซ้อนของ syntex ว่าควรตัดตัวไหนได้บ้าง เพราะถ้าเกิดต่อไปเขียนโปรแกรมที่ซับซ้อนมากกว่านี้
ความกระชับของโค๊ด มีผลต่อการตัดสินใจเป็นอย่างมากครับ


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-11 08:37:32 By : lamaka.tor
 


 

No. 26



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 24 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-10 22:51:29
รายละเอียดของการตอบ ::
เอา SQL ไปใส่ใน GetTableOLEDB() ดูครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-11 08:48:09 By : lamaka.tor
 


 

No. 27



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

แก้เป็นชั่วโมงก็ไม่ได้ซักที
ด
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-11 19:13:39 By : souyofnewerth
 


 

No. 28



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ใส่.ToString ก็ขึ้นแบบนี้
f

ใส่ MessageBox.Show(chbndrug.SelectedValue) รันได้พอเลือกแล้วขึ้น MsgBox ว่าง ๆ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-11 19:17:13 By : souyofnewerth
 


 

No. 29



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ที่ถูกต้องเป็น
chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory where n_typedrug=" & chbndrug.SelectedValue, cnn)
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-12 08:27:42 By : lamaka.tor
 


 

No. 30



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ใส่แบบนั้นก็เอออร่อครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-12 08:30:12 By : souyofnewerth
 


 

No. 31



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 30 เขียนโดย : souyofnewerth เมื่อวันที่ 2015-02-12 08:30:12
รายละเอียดของการตอบ ::
SQL ถูกแล้วครับ
ใส่

Code
if(chbndrug.SelectedValue <> "" ) then chbndrug.DataSource = GetTableOLEDB("SELECT * FROM inventory where n_typedrug=" & chbndrug.SelectedValue, cnn) endif


ดักจับ ค่า Null มัน

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-02-12 09:05:11 By : lamaka.tor
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : อยากให้โค้ดเงือนไข Combobox 2 อันดึงจากฐานข้อมูล MS Access
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่