|
 |
|
vb.net ขอความช่วยเหลือ+อยากทราบปัญหา เพิ่มข้อมูลลงฐานไม่ได้ ไม่รู้เป็นอะไร |
|
 |
|
|
 |
 |
|
อยากทราบว่า เขียนโค้ดเพิ่มข้อมูลลงฐานแล้ว แต่มันไม่ลงฐาน และไม่มีปรากฏการณ์อะไรเกิดขึ้นเลย แม้แต่ Eror ก็ไม่มีบอก มีเพียงแต่เว็บบราวเซอร์ยังทำงานอยู่เหมือนว่ากำลังโหลดอะไรสักอย่างอยู่ ขอความช่วยเหลือจากผู้รู้ช่วยแนะนำด้วยครับ / ขอบคุณครับ
<<<<นี่คือโค้ดน่ะครับ>>>>>>>>>>
Code (VB.NET)
Imports System.IO
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Data
Partial Class Customers
Inherits System.Web.UI.Page
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim objConn As New SqlConnection
Dim objCmd As New SqlCommand
Dim strConnString, strSQL As String
strConnString = "Server=localhost;UID=sa;PASSWORD=;database=POSDB;Max Pool Size=400;Connect Timeout=600;"
strSQL = "INSERT INTO tblcustomer (CustomerCode, CustomerName, Address, Memo, Nick, Age, IDCard, Birthday, AdHome, AdOffice Other, How, Dumnern, Aregon, Ownta, Tawparsri, Prb, Tumneam, YodBun, Otherss, Rum, Rubsud, ngensod, Rubngen, TudBun, Phuchao, jaonatee, tho, PidBun, INV, Fax, Lam, OwnBun, BunChee, NumBun, Kammasit, saka, Car, Run, jodta, MM, CarID, Parsri, NumSecurity, Numtung, CarCare, NumMike, Buy, MKT, Yodjud, Pon, Ngud, Ngudsud, ponrom, NgudRak, BK, Money) " & _
" VALUES " & _
" ('" & Me.txtCustomerCode.Text & "','" & Me.txtCustomerName.Text & "','" & Me.txtAddress.Text & "','" & Me.txtMemo.Text & "','" & Me.txtNick.Text & "','" & Me.txtAge.Text & "','" & Me.txtIdcard.Text & "','" & Me.txtBirthday.Text & "','" & Me.txtAdHome.Text & "','" & Me.txtAdOffice.Text & "','" & Me.txtOther.Text & "','" & Me.txtHow.Text & "','" & Me.txtDumnern.Text & "','" & Me.txtAregon.Text & "','" & Me.txtOwnta.Text & "','" & Me.txtTawparsri.Text & "','" & Me.txtPrb.Text & "','" & Me.txtTumneam.Text & "','" & Me.txtYodBun.Text & "','" & Me.txtOtherss.Text & "','" & Me.txtRum.Text & "','" & Me.txtRubsud.Text & "','" & Me.txtngensod.Text & "','" & Me.txtRubngen.Text & "','" & Me.txtTudBun.Text & "','" & Me.txtPhuchao.Text & "','" & Me.txtjaonatee.Text & "','" & Me.txttho.Text & "','" & Me.txtPidBun.Text & "','" & Me.txtINV.Text & "','" & Me.txtFax.Text & "','" & Me.txtLam.Text & "','" & Me.txtOwnBun.Text & "','" & Me.txtBunChee.Text & "','" & Me.txtNumBun.Text & "','" & Me.txtKammasit.Text & "','" & Me.txtsaka.Text & "','" & Me.txtCar.Text & "','" & Me.txtRun.Text & "','" & Me.txtjodta.Text & "','" & Me.txtMM.Text & "','" & Me.txtCarID.Text & "','" & Me.txtParsri.Text & "','" & Me.txtNumSecurity.Text & "','" & Me.txtNumtung.Text & "','" & Me.txtCarCare.Text & "','" & Me.txtNumMike.Text & "','" & Me.txtBuy.Text & "','" & Me.txtMKT.Text & "','" & Me.txtYodjud.Text & "','" & Me.txtPon.Text & "','" & Me.txtNgud.Text & "','" & Me.txtNgudsud.Text & "','" & Me.txtponrom.Text & "', " & _
" '" & Me.txtNgudRak.Text & "','" & Me.txtBK.Text & "','" & Me.txtMoney.Text & "')"
objConn.ConnectionString = strConnString
objConn.Open()
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
Try
objCmd.ExecuteNonQuery()
Me.lblStatus.Text = "Record Inserted"
Me.lblStatus.Visible = True
Catch ex As Exception
Me.lblStatus.Visible = True
Me.lblStatus.Text = "Record can not insert Error (" & ex.Message & ")"
End Try
objConn.Close()
objConn = Nothing
End Sub
End Class
Tag : ASP.NET Ms Access, Web (ASP.NET), VS 2010 (.NET 4.x)

|
|
 |
 |
 |
 |
Date :
2013-03-13 23:32:48 |
By :
Prajoubdls |
View :
781 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้างั้นคงจะต้องใช้การ Debug ดูครับ ว่ามันไปหยุดตรงไหนครับ
|
 |
 |
 |
 |
Date :
2013-03-14 06:58:06 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เท่าที่ดู คงต้อง Debug ดูละคับ ว่าเกิดไรขึ้น
เพราะดูๆ ก็น่าจะถูกแล้ว
|
 |
 |
 |
 |
Date :
2013-03-14 09:17:00 |
By :
diysms |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|