fomat exception, datagridview, sqlite
<p>I am getting this error: </p>

<pre><code>Error: Format Exception: Input string was not in a correct format.
</code></pre>

<p>at</p>

<pre><code>foreach (DataRow row in dtChanges.Rows)
            {
                using (SQLiteConnection conn = new SQLiteConnection(connString))
                {
                    conn.Open();
                    SQLiteCommand upCmd = new SQLiteCommand(@"update.......",conn);
           upCmd.Parameters.AddWithValue("@Flux",float.Parse(row["Flux"].ToString()));
</code></pre>

<p>This row["Flux"] is from the datagridview. It could be an "" string. I suppose this is what is causing the problem. Flux is a numeric in the DB. I am sqlite DB.
I understand this error that "" cannot be converted to a decimal. But what would be the best way to tackle this?</p>

<pre><code>Stack Trace: 
       at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
       at System.Single.Parse(String s)
       at RVEST.frmVesselData.SaveData(DataGridView dgv) in C:\D_Drive_Stuff\RVESTV2\RVEST\frmVesselData.cs:line 249
       at RVEST.frmVesselData.btnSave_Click(Object sender, EventArgs e) in C:\D_Drive_Stuff\RVESTV2\RVEST\frmVesselData.cs:line 190
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       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.ButtonBase.WndProc(Message&amp; m)
       at System.Windows.Forms.Button.WndProc(Message&amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at RVEST.Program.Main() in C:\RVEST\Program.cs:line 26
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
</code></pre>

<p>Thank yu
Sun</p>
