 |
|
เขียน sub เพื่อเคลียร์ค่าใน Control Combobox VB.net |
|
 |
|
|
 |
 |
|

ขอบคุณครับ :) สอบถามปัญหาเพิ่มเติมหน่อยครับ Lookup แล้ว Error อย่างนี้ครับ ไม่รู้ว่าแนวคิดถูกหรือไม่ฮ่ะ
Code (VB.NET)
Private Sub LookupIssueTypeBy(ByVal str_JobtypeCode As String)
If ds.Tables.Contains("ds_IssueType") = True Then
ds.Tables("ds_IssueType").Clear()
End If
strSQL = ""
strSQL = "select issueTypecode,issueTypeDesc from tblissueType where jobtypeID='" & str_JobtypeCode & "' or jobtypeID='00' order by issueTypeCode ASC"
da = New SqlDataAdapter(strSQL, Cn)
da.Fill(ds, "ds_Issuetype")
If ds.Tables("ds_Issuetype").Rows.Count <> 0 Then
With cmbIssueType
.DataSource = ds.Tables("ds_Issuetype")
.ValueMember = "IssueTypecode"
.DisplayMember = "IssueTypedesc"
.SelectedIndex = 0
End With
End If
End Sub
Private Sub LookupIssueSystemBy(ByVal str_IssuetypeCode As String)
If ds.Tables.Contains("ds_IssueSystem") = True Then
ds.Tables("ds_IssueSystem").Clear()
End If
strSQL = ""
strSQL = "select sysCode,sysDesc from tblissueSystem where issuetypeCode='" & str_IssuetypeCode & "' or issuetypeCode='00' order by sysCode ASC"
da = New SqlDataAdapter(strSQL, Cn)
If ds.Tables("ds_IssueSystem").Rows.Count <> 0 Then
With cmbissueSystem
.DataSource = ds.Tables("ds_IssueSystem")
.ValueMember = "syscode"
.DisplayMember = "sysdesc"
.SelectedIndex = 0
End With
End If
End Sub
Private Sub LookupIssueTopicBy(ByVal str_sysCode As String)
If ds.Tables.Contains("ds_IssueTopic") = True Then
ds.Tables("ds_IssueTopic").Clear()
End If
strSQL = ""
strSQL = "select TopicCode,TopicDesc from tblissueTopic where sysCode='" & str_sysCode & "' or sysCode='00' order by topicCode ASC"
da = New SqlDataAdapter(strSQL, Cn)
If ds.Tables("ds_IssueTopic").Rows.Count <> 0 Then
With cmbIssueTopic
.DataSource = ds.Tables("ds_IssueTopic")
.ValueMember = "Topiccode"
.DisplayMember = "Topicdesc"
.SelectedIndex = 0
End With
End If
End Sub
Private Sub cmbIssueType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbIssueType.SelectedIndexChanged
LookupIssueSystemBy(cmbIssueType.SelectedValue.ToString)
End Sub
Private Sub cmbJobtype_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbJobtype.SelectedIndexChanged
LookupIssueTypeBy(cmbJobtype.SelectedValue.ToString)
End Sub
Private Sub cmbissueSystem_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbissueSystem.SelectedIndexChanged
LookupIssueTopicBy(cmbissueSystem.SelectedValue.ToString)
End Sub
|
 |
 |
 |
 |
Date :
2013-04-07 18:16:56 |
By :
หัดเดิน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|




รบกวนด้วยครับ
|
 |
 |
 |
 |
Date :
2013-04-07 18:21:37 |
By :
หัดเดิน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ :) สอบถามปัญหาเพิ่มเติมหน่อยครับ Lookup แล้ว Error อย่างนี้ครับ ไม่รู้ว่าแนวคิดถูกหรือไม่ฮ่ะ
--- แนวคิดถูกแต่วิธีการเขียน ไม่ถูกต้องและหลงทาง (คนที่ใช้คำว่า Lookup แสดงว่าไม่ธรรมดา)
|
 |
 |
 |
 |
Date :
2013-04-09 20:59:47 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
--- แนวคิดถูกแต่วิธีการเขียน ไม่ถูกต้องและหลงทาง (คนที่ใช้คำว่า Lookup แสดงว่าไม่ธรรมดา)
ผมทำเป็นตัวอย่างจริง เพื่ออธิบายให้เข้าใจ ---- จังหวัด --> อำเภอ --> ตำบล --> ย่านไหน == Users --> Roles --> Rights --> Page (ย่านไหน)
www.goodluck.smpksme.com
User ID : Dang
Password : 2516
ปล. มันมีข้อบกพร่องเยอะแยะ แต่ไม่ใช่สาระสำคัญ
|
 |
 |
 |
 |
Date :
2013-04-09 21:17:46 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
:) ดูตรงส่วนไหนครับ ประวัติลูกค้าหรือเปล่า ?
|
 |
 |
 |
 |
Date :
2013-04-10 13:36:36 |
By :
หัดเดิน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
:) ดูตรงส่วนไหนครับ ประวัติลูกค้าหรือเปล่า ?
-----> 1/1000000*1000000
ปล.
----------> ถ้ามีข้อสงสัยเบื้องต้นว่า
----------> ภรรยาของผม สวยไหม? ผมตอบได้เต็มปากเต็มคำว่า สวย
----------> ถ้ามีข้อสงสัยเบื้องต้นว่า
----------> ภรรยาของผม สูงไหม? ผมตอบได้เต็มปากเต็มคำว่า สูงประมาณ 154 cm.
----------> ถ้ามีข้อสงสัยเบื้องต้นว่า
----------> ภรรยาของผม หอยใหญ่ไหม? ผมตอบได้แบบน้ำท่วมปาก เต็มปาก เต็มคำว่า พอประมาณ
----------> ถ้า เชื่อตามข้อสงสัยเบื้องต้น และยังลังเล และมีคำถามตามมาว่า?
----------> ขอจับหอยดูหน่อยได้ไหม? เพราะอยากรู้ว่าใหญ่หรือเล็ก (นักวิทยาศาสตร์ ชอบทดลอง)
----------> ...
|
 |
 |
 |
 |
Date :
2013-04-10 21:57:59 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
:( เศร้าฮ๋ะ ยัง debug อยู่เลย
|
 |
 |
 |
 |
Date :
2013-04-17 18:56:56 |
By :
หัดเดิน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|