|
 |
|
มีปัญหาการเรื่อง Insert ข้อมูลลง SQL รบกวนช่วยทีนะครับ |
|
 |
|
|
 |
 |
|
รบกวนหน่อยครับพอดีงมหาทั้งวันแล้วครับติดอยู่ Table นี้ Table เดียว และสุดท้าย Insert ลง SQL ไม่ได้รบกวนช่วยดูให้ทีนะครับ ขอบคุณครับ

Code (VB.NET)
Private Sub save_ServerClick(sender As Object, e As EventArgs) Handles save.ServerClick
Dim PCID As Integer = gvData.SelectedRow.Cells(1).Text.ToString
If FileUpload1.HasFile Then
' ชื่อไฟล์เดิม ที่ใช้ Upload / เวลาปัจจุบัน TimeStamp / นามสกุลไฟล์
Dim newFileName As String = String.Concat(Path.GetFileNameWithoutExtension(FileUpload1.FileName), DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss-fff"), Path.GetExtension(FileUpload1.FileName))
Dim sql As New StringBuilder
sql.Append("Insert Into Incident_record")
sql.Append("(Datetime_report, Datetime_incident, Detail_incident, Output_incident, improvement, file_incident, Type_impact_code, Patient_code, Location_code, Simple_code, Ai_code, Type_risk_code, Building_code, Location_Units_code, User_code, reporter_code, Status_process_code)")
sql.Append("Values (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17)")
Dim cmd = GetCon.CreateCommand(sql.ToString)
GetCon.CreateParam(cmd, "DTTTTTITIIIIIIIII")
cmd.Parameters("@P1").Value = DateTime.Now.ToString("s")
cmd.Parameters("@P2").Value = CDate(pkdatetime2.Text).ToString("s")
cmd.Parameters("@P3").Value = Ck_Detail.Text
cmd.Parameters("@P4").Value = Ck_Output.Text
cmd.Parameters("@P5").Value = Ck_Set.Text
cmd.Parameters("@P6").Value = newFileName
cmd.Parameters("@P7").Value = RadioTypeIm.SelectedValue
cmd.Parameters("@P8").Value = idpt.Text
cmd.Parameters("@P9").Value = DropDownLocation.SelectedValue
cmd.Parameters("@P10").Value = RadioSimple.SelectedValue
cmd.Parameters("@P11").Value = DropDownAI.SelectedValue
cmd.Parameters("@P12").Value = RadioTyperisk.SelectedValue
cmd.Parameters("@P13").Value = RadioBuilding.SelectedValue
cmd.Parameters("@P14").Value = DropDownLocationUnits.SelectedValue
cmd.Parameters("@P15").Value = Session("ID")
cmd.Parameters("@P16").Value = RadioReporter.SelectedValue
cmd.Parameters("@P17").Value = 1
Try
GetCon.Execute(cmd)
FileUpload1.SaveAs(Server.MapPath("file/incident/") & newFileName)
Page.Response.Write("<script language=javascript> alert(""บันทึก ข้อมูลเรียบร้อย"");location.href='ViewPatient.aspx';</script>")
Catch ex As Exception
Page.Response.Write("<script language=javascript> alert(""บันทึก ข้อมูลเรียบร้อย"");location.href='ViewPatient.aspx';</script>")
End Try
Else
Page.Response.Write("<script language=javascript> alert(""บันทึก ข้อมูลผิดพลาด"");location.href='AuthenAdd.aspx';</script>")
End If
End Sub
Tag : ASP, VB.NET, Windows

|
|
 |
 |
 |
 |
Date :
2016-12-01 21:18:02 |
By :
velonz |
View :
785 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่ได้เพราะอะไร error อะไร
script sql ถูกหรือป่าว ได้ลองเอาไปรันในโปรแกรมหรือยัง
error อะไรก็แคปมาให้คนอื่นดูด้วยครับ เวลาคนมาช่วยตอบเขาจะได้เข้าใจง่ายๆ 
|
 |
 |
 |
 |
Date :
2016-12-02 09:19:39 |
By :
Mr.T-Bag |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|