Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to change SQL column type in visual studio C#
    primarykey
    data
    text
    <p>I made a C# Program with sql database,<br> after finishing the program and start working on it I want to change one of the columns type from int to nvarchar(50), knowing that the database had been filled with data. </p> <p>I changed the table column type to nvarchar(50), and change it also on the dataset to System.String.<br> After Running the program it gives me this exception </p> <pre><code>See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.FormatException: Failed to convert parameter value from a String to a Int32. ---&gt; System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean&amp; coercedToDataFeed, Boolean&amp; typeChanged, Boolean allowStreaming) --- End of inner exception stack trace --- at Tiryaq.TiryaqDatabaseDataSetTableAdapters.TableAdapterManager.UpdateAll(TiryaqDatabaseDataSet dataSet) in C:\Users\Firas\Documents\Visual Studio 2010\Projects\Tiryaq\Tiryaq\TiryaqDatabaseDataSet.Designer.cs:line 1973 at Tiryaq.Form1.medicinTableBindingNavigatorSaveItem_Click(Object sender, EventArgs e) in C:\Users\Firas\Documents\Visual Studio 2010\Projects\Tiryaq\Tiryaq\Form1.cs:line 31 at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message&amp; m) at System.Windows.Forms.ToolStrip.WndProc(Message&amp; m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) </code></pre> <p>thank you. </p> <p>UPDATE : actually the exception rise when clicking the save button<br> here is the method </p> <pre><code>private void medicinTableBindingNavigatorSaveItem_Click(object sender, EventArgs e) { { this.Validate(); this.medicinTableBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.tiryaqDatabaseDataSet); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload