Click here to Skip to main content
15,065,644 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Cannot figure this one out.... SQL datasource & c# Pin
Mike Ellison11-Jul-08 15:31
MemberMike Ellison11-Jul-08 15:31 
GeneralRe: Cannot figure this one out.... SQL datasource & c# Pin
Jacob Dixon12-Jul-08 4:31
MemberJacob Dixon12-Jul-08 4:31 
Questionhow to close/hide the popup onmouseout event Pin
For_IT11-Jul-08 15:06
MemberFor_IT11-Jul-08 15:06 
QuestionControlling page elements from a .config file Pin
Cyberpulse11-Jul-08 14:10
MemberCyberpulse11-Jul-08 14:10 
AnswerRe: Controlling page elements from a .config file Pin
Mike Ellison11-Jul-08 15:36
MemberMike Ellison11-Jul-08 15:36 
QuestionCustom control for FormView? Pin
equalizer70011-Jul-08 8:49
Memberequalizer70011-Jul-08 8:49 
AnswerRe: Custom control for FormView? Pin
Paul Conrad11-Jul-08 9:59
professionalPaul Conrad11-Jul-08 9:59 
QuestionHelp - >SQLException Pin
AprNgp11-Jul-08 8:19
MemberAprNgp11-Jul-08 8:19 
My code is
public void Insert()
    {
        string query =
            "INSERT INTO WordTable (Word_ID,Word,Help) " +
            "VALUES (@Word_ID,@Word,@Help)";
        SqlConnection conn = new SqlConnection(cs);
        SqlCommand cmd = new SqlCommand(query, conn);
        cmd.Parameters.Add(new SqlParameter("@Word_ID",this.Word_ID));
        cmd.Parameters.Add(new SqlParameter ("@Word",this.word));
        cmd.Parameters.Add(new SqlParameter ("@Help",this.Help));
        conn.Open();
        cmd.ExecuteScalar();
    }


And the exception is
System.Data.SqlClient.SqlException was unhandled by user code
  Message="String or binary data would be truncated.\r\nThe statement has been terminated."
  Source=".Net SqlClient Data Provider"
  ErrorCode=-2146232060
  Class=16
  LineNumber=1
  Number=8152
  Procedure=""
  Server="\\\\.\\pipe\\F52FA45D-C426-4C\\tsql\\query"
  State=13
  StackTrace:
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteScalar()
       at SQLWord.Insert() in e:\asp.net\hangaro\App_Code\SQLWord.cs:line 48
       at WordList.AddWord(SQLWord w) in e:\asp.net\hangaro\App_Code\WordList.cs:line 52
       at Add_Word.WriteToSQL() in e:\asp.net\hangaro\Add_Word.aspx.cs:line 60
       at Add_Word.Add_Click(Object sender, EventArgs e) in e:\asp.net\hangaro\Add_Word.aspx.cs:line 36
       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: 



I have checked the values of
this.Word_ID etc...
What shall I do ?

Apurv

AnswerRe: Help - >SQLException Pin
ToddHileHoffer11-Jul-08 9:27
MemberToddHileHoffer11-Jul-08 9:27 
QuestionGetting information from datalist Pin
Jacob Dixon11-Jul-08 7:14
MemberJacob Dixon11-Jul-08 7:14 
AnswerRe: Getting information from datalist Pin
Parwej Ahamad11-Jul-08 7:26
professionalParwej Ahamad11-Jul-08 7:26 
AnswerRe: Getting information from datalist Pin
Sherin Iranimose11-Jul-08 7:35
MemberSherin Iranimose11-Jul-08 7:35 
GeneralRe: Getting information from datalist Pin
Jacob Dixon11-Jul-08 9:46
MemberJacob Dixon11-Jul-08 9:46 
AnswerRe: Getting information from datalist Pin
Sneha Bisht11-Jul-08 21:31
MemberSneha Bisht11-Jul-08 21:31 
QuestionRegular expression for valid time format (hr:min:sec) entered by user in text box Pin
For_IT11-Jul-08 6:51
MemberFor_IT11-Jul-08 6:51 
AnswerRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
Paul Conrad11-Jul-08 10:00
professionalPaul Conrad11-Jul-08 10:00 
GeneralRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
For_IT11-Jul-08 14:54
MemberFor_IT11-Jul-08 14:54 
GeneralRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
Paul Conrad11-Jul-08 15:00
professionalPaul Conrad11-Jul-08 15:00 
GeneralRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
For_IT13-Jul-08 13:03
MemberFor_IT13-Jul-08 13:03 
QuestionHow to edit FormView Templates in WYSIWYG mode? Pin
equalizer70011-Jul-08 5:24
Memberequalizer70011-Jul-08 5:24 
AnswerRe: How to edit FormView Templates in WYSIWYG mode? Pin
Herman<T>.Instance14-Jul-08 20:04
MemberHerman<T>.Instance14-Jul-08 20:04 
GeneralRe: How to edit FormView Templates in WYSIWYG mode? Pin
equalizer70015-Jul-08 4:01
Memberequalizer70015-Jul-08 4:01 
GeneralRe: How to edit FormView Templates in WYSIWYG mode? Pin
Herman<T>.Instance15-Jul-08 5:20
MemberHerman<T>.Instance15-Jul-08 5:20 
GeneralRe: How to edit FormView Templates in WYSIWYG mode? Pin
equalizer70015-Jul-08 7:08
Memberequalizer70015-Jul-08 7:08 
GeneralRe: How to edit FormView Templates in WYSIWYG mode? Pin
Herman<T>.Instance15-Jul-08 7:35
MemberHerman<T>.Instance15-Jul-08 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.