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 > มันขึ้น Errors แบบนี้ครับ ทำไงดี แก้ยังไง รบกวนด้วยครับ (ผมทำโปรเจคอยู่ครับ ใกล้ส่งแล้วด้วย!!!)



 

มันขึ้น Errors แบบนี้ครับ ทำไงดี แก้ยังไง รบกวนด้วยครับ (ผมทำโปรเจคอยู่ครับ ใกล้ส่งแล้วด้วย!!!)

 



Topic : 026414

Guest




Code
Server Error in '/WebSite Kanok' Application.
--------------------------------------------------------------------------------

String or binary data would be truncated.
The statement has been terminated.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.

Source Error:


Line 17: srcCustomerProfile.InsertParameters("M_ZipCode").DefaultValue = txtZipcode.Text
Line 18: srcCustomerProfile.InsertParameters("M_UserName").DefaultValue = txtUsername.Text
Line 19: srcCustomerProfile.Insert()
Line 20: Roles.AddUserToRole(txtUsername.Text, "Member")
Line 21: Microsoft.VisualBasic.MsgBox("การสมัครสมาชิกเสร็จสมบูรณ์", MsgBoxStyle.OkOnly, "กนกวิมาน สปอร์คลับ")


Source File: D:\Project 442\WebSite Kanok\Register.aspx Line: 19

Stack Trace:


[SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +109
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +57
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +207
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2433
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +148
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +949
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +242
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +289
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +117
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +377
System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +235
System.Web.UI.WebControls.SqlDataSource.Insert() +16
ASP.register_aspx.btnSubmit_Click(Object sender, EventArgs e) in D:\Project 442\WebSite Kanok\Register.aspx:19
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +78
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +100
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2863




Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2009-04-19 09:14:32 By : oasiis View : 33799 Reply : 15
 

 

No. 1



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



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


*******ต่อจากข้างบนครับ**********

คือผมเขียน code แบบนี้แล้วมัน ERROR แบบข้างบนครับ ช่วยผมหน่อยน่ะครับ


<script runat="server"> 'ทำงานเมื่อผู้ใช้กรอกข้อมูลการสมัครสมาชิกเสร็จและคลิกปุ่ม ?สมัครสมาชิก? Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim status As MembershipCreateStatus Membership.CreateUser(txtUsername.Text, txtPassword.Text, txtEmail.Text, ddlQuestion.Text, txtAnswer.Text, True, status) If status = MembershipCreateStatus.Success Then srcCustomerProfile.InsertParameters("M_FirstName").DefaultValue = txtFirstName.Text srcCustomerProfile.InsertParameters("M_LastName").DefaultValue = txtLastName.Text srcCustomerProfile.InsertParameters("M_TelNo").DefaultValue = txtPhone.Text srcCustomerProfile.InsertParameters("M_MobileNo").DefaultValue = txtMobile.Text srcCustomerProfile.InsertParameters("M_Address").DefaultValue = txtAddress.Text srcCustomerProfile.InsertParameters("M_Province").DefaultValue = txtProvince.Text srcCustomerProfile.InsertParameters("M_City").DefaultValue = ddlCity.Text srcCustomerProfile.InsertParameters("M_ZipCode").DefaultValue = txtZipcode.Text srcCustomerProfile.InsertParameters("M_UserName").DefaultValue = txtUsername.Text srcCustomerProfile.Insert() Roles.AddUserToRole(txtUsername.Text, "Member") Microsoft.VisualBasic.MsgBox("การสมัครสมาชิกเสร็จสมบูรณ์", MsgBoxStyle.OkOnly, "กนกวิมาน สปอร์คลับ") MultiView1.ActiveViewIndex = MultiView1.ActiveViewIndex + 1 ElseIf status = MembershipCreateStatus.DuplicateEmail Then lblMessage.Text = "อีเมล์ซ้ำ กรุณาใส่ใหม่" ElseIf status = MembershipCreateStatus.DuplicateUserName Then lblMessage.Text = "ชื่อผู้ใช้ซ้ำ กรุณาใส่ใหม่" ElseIf status = MembershipCreateStatus.InvalidEmail Then lblMessage.Text = "คุณใส่อีเมล์ไม่ถูกต้อง" ElseIf status = MembershipCreateStatus.InvalidPassword Then lblMessage.Text = "คุณใส่รหัสผ่านไม่ถูกต้อง" Else lblMessage.Text = "เกิดข้อผิดพลาดในการลงทะเบียน กรุณาลงทะเบียนใหม่" End If End Sub 'ทำงานหลังจากการสมัครสมาชิกสำเร็จ Protected Sub View3_Load(ByVal sender As Object, ByVal e As System.EventArgs) lblShowName.Text = txtFirstName.Text lblShowUsername.Text = txtUsername.Text lblShowPassword.Text = txtPassword.Text End Sub 'ทำงานเมื่อโหลดเพจขึ้นมาครั้งแรก โดยกำหนดค่า Index เริ่มต้นให้กับ MultiView1 เท่ากับ 0 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) If Not Page.IsPostBack Then MultiView1.ActiveViewIndex = 0 End If End Sub 'ทำงานหลังจากเลือกเงื่อนไขในการสมัครสมาชิกและคลิกปุ่ม ?ลงทะเบียน? Protected Sub btnRegister_Click(ByVal sender As Object, ByVal e As System.EventArgs) If rdbtnAgree.Items.Item(0).Selected Then MultiView1.ActiveViewIndex = 1 Else Response.Redirect("~\Home.aspx") End If End Sub </script>






******มันต้องการตรงไหนครับ*****






Date : 2009-04-19 09:35:10 By : oasiis
 


 

No. 2



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



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


คิดว่าคุณน่าจะส่ง Parameter ที่มี Datatype ผิดประเภทไปนะครับที่ไม่ตรงกับ Datatype ใน Database
Date : 2009-04-20 09:20:42 By : sspt
 

 

No. 3



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



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

ปัญหานี้เกิดจากว่า Field ใน Database มีขนาดเล็กกว่าจำนวนข้อมูลที่จะใส่เข้าไปครับผม ลองตรวจสอบดูครับ
Date : 2009-04-20 11:04:13 By : anucham
 


 

No. 4

Guest


555555555555555555555555555555555555555555555555555
Date : 2010-02-14 20:08:45 By : 555
 


 

No. 5



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



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


แก้ได้หรือยังครับ error นี้ ผมก็เจอเหมือนกัน
Date : 2011-03-22 12:03:35 By : kittipoth
 


 

No. 6



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



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


String or binary data would be truncated.

ถ้าเป็น error กรณีครับ data input เยอะกว่าที่ database จะเก็บได้ครับ
Date : 2011-03-24 16:08:18 By : dirmus
 


 

No. 7

Guest


thank มากๆๆครับ ดาต้าเบส บรรจุข้อมูลที่นำเข้าไม่พอจริงด้วย
Date : 2011-12-01 10:51:21 By : มกรา
 


 

No. 8

Guest


ขอบคุณนะครับ ความรู้ใหม่ๆ
Date : 2011-12-24 10:32:14 By : ILove
 


 

No. 9

Guest


เจอเหมือนกันอ่าา ทำไงงง ใครรู้ช่วยบอกที โปรเจคจบด้วย T^T
Date : 2012-11-09 14:07:13 By : auiVP
 


 

No. 10



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



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


ขอบคุณมากๆ ค่ะ แก้ได้จริงๆด้วย
Date : 2015-01-12 14:32:52 By : namaza
 


 

No. 11



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



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

ปัญหานี้เกิดขึ้นได้เสมอสำหรับข้อมูลที่เป็น String ครับ
Date : 2015-01-14 10:32:59 By : Programmer ด้อยปัญญา
 


 

No. 12



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



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


วิธีแก้ทำอย่างไรหรอครับ
Date : 2015-04-03 10:01:54 By : tongiggabite
 


 

No. 13

Guest


ติดปัญหานี้เหมือนกัน
แก้ อย่างไรรึค่ะ เพิ่งเริ่มศึกษา งูๆปลาๆ ทำไม่ค่อยถูกค่ะ รบกวนด้วยค่ะ
Date : 2016-08-15 09:26:21 By : far
 


 

No. 14



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



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


แก้ไขโดยการเพิ่มขนาดของฐานข้อมูลให้เก็บจำนวนให้มากพอที่จะใส่ลงค่ะ
Date : 2018-04-04 14:52:50 By : ipchully
 


 

No. 15

Guest


กำลังเจอปัญหานี้เลย








คาสิโนออนไลน์
Date : 2018-04-09 12:37:23 By : Lion88
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : มันขึ้น Errors แบบนี้ครับ ทำไงดี แก้ยังไง รบกวนด้วยครับ (ผมทำโปรเจคอยู่ครับ ใกล้ส่งแล้วด้วย!!!)
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่