|
 |
พอดีมันไม่ขึ้น MessageBox อะครับ แต่ฟอร์มอื่นขึ้น งง มันเป็นเพราะอะไรผมไล่ Code ดูแล้วมันก็ไม่มีอะไรผิด รบกวนช่วยดูหน่อยครับ |
|
 |
|
|
 |
 |
|
พอดีมันไม่ขึ้น MessageBox อะครับ แต่ฟอร์มอื่นขึ้น งง มันเป็นเพราะอะไรผมไล่ Code ดูแล้วมันก็ไม่มีอะไรผิด รบกวนช่วยดูหน่อยครับ
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Myscript", "alert('บันทึกการแจ้งปัญหาสำเร็จ')", true);
Response.Redirect("~/RequestionShow");
แต่พอลบ Response.Redirect("~/RequestionShow"); ออก MessageBox ดันโชว์ ผม งง มากเลยครับ
Code (C#)
SqlConnection conn = new SqlConnection("Data Source=ART\\SQL2014;Initial Catalog=SvlIT;User ID=it;Password=1234");
conn.Open();
SqlCommand sqlcom = conn.CreateCommand();
sqlcom.CommandText = "INSERT INTO [dbo].[Case] ( [CaseName], [CaseDetail], [CaseDT], [CaseStatusKey], [Requester], [UsrKey], [CaseTypeKey],[CaseCode]) VALUES ( '" + TextBox1.Text + "','" + Request.Form["Message"] + "','" + TextBox3.Text + "',1,'" + TextBox5.Text + "','" + DropDownList4.Text + "','" + DropDownList3.Text + "','"+TextBox6.Text+"')";
//sqlcom.CommandText = "INSERT INTO [dbo].[Case] Select CaseTypeKey, CodeType, NameType From [dbo].[Case] INNER JOIN [dbo].[CaseTypeKey] ON [dbo].[Case].CaseTypeKey = [dbo].[CaseType].CaseTypeKey where CaseTypeKey = NameType ( [CaseName], [CaseDetail], [CaseDT], [CaseStatusKey], [Requester], [UsrKey], [CaseTypeKey]) VALUES" + "('" + TextBox1 + "','" + TextBox2 + "','" + TextBox3 + "','" + TextBox4 + "','" + TextBox5 + "','" + TextBox6 + "','" + Dropdownlist1 + "')";
//sqlcom.CommandText = "INSERT INTO[dbo].[CaseType] ( [CodeType], [NameType]) VALUES" + "('" + this.TextBox2.Text + "','" + TextBox3.Text + "')";
sqlcom.CommandType = CommandType.Text;
sqlcom.ExecuteNonQuery();
conn.Close();
TextBox1.Text = "";
TextBox5.Text = "";
DropDownList3.Text = "0";
DropDownList4.Text = "0";
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Myscript", "alert('บันทึกการแจ้งปัญหาสำเร็จ')", true);
Response.Redirect("~/RequestionShow");
Tag : Web (ASP.NET), C#
|
ประวัติการแก้ไข 2018-10-30 14:51:29 2018-10-30 14:55:14 2018-10-30 15:26:23
|
 |
 |
 |
 |
Date :
2018-10-30 14:50:54 |
By :
wiraphon |
View :
914 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
RequestionShow มันหาบ่เห็นเด้
|
 |
 |
 |
 |
Date :
2020-08-02 22:37:49 |
By :
PhrayaDev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|