Prev: Load a Win32dll
Next: Data Readers
From: redbull on 2 Jul 2010 06:42 Hi guys, I've created a simple webpage with a datagridview, my business object. If i try to modify a record i get an error on date value: Dettagli eccezione: System.InvalidOperationException: Impossible to convert the value of parameter 'DataNascita' from 'System.String' to 'System.DateTime'. What should I do? Thanks
From: Mr. Arnold on 2 Jul 2010 07:24 redbull wrote: > Hi guys, I've created a simple webpage with a datagridview, my business > object. > If i try to modify a record i get an error on date value: > > Dettagli eccezione: System.InvalidOperationException: Impossible to > convert the value of parameter 'DataNascita' from 'System.String' to > 'System.DateTime'. > What should I do? > Thanks You can't populate a DateTime value field or variable with string data representing a date and time. The string date and time must be converted over to System.Datetime before the field or variable can be populated by string data the represents a date and time. You should look up how to use the 'Convert' statement.
From: redbull on 2 Jul 2010 07:48 "Mr. Arnold" <Arnold(a)Arnold.com> ha scritto nel messaggio news:Ox8s0kdGLHA.5700(a)TK2MSFTNGP04.phx.gbl... > redbull wrote: >> Hi guys, I've created a simple webpage with a datagridview, my business >> object. >> If i try to modify a record i get an error on date value: >> >> Dettagli eccezione: System.InvalidOperationException: Impossible to >> convert the value of parameter 'DataNascita' from 'System.String' to >> 'System.DateTime'. >> What should I do? >> Thanks > > You can't populate a DateTime value field or variable with string data > representing a date and time. > > The string date and time must be converted over to System.Datetime before > the field or variable can be populated by string data the represents a > date and time. > > You should look up how to use the 'Convert' statement. to insert the value i do: persona.data= Convert.ToDateTime(Me.TextBox3.Text) The problem raises when i click on update dategridview.....but how can I modify code related to selcet/update/insert in datagridview? Thanks
From: Mr. Arnold on 2 Jul 2010 14:54 redbull wrote: > > "Mr. Arnold" <Arnold(a)Arnold.com> ha scritto nel messaggio > news:Ox8s0kdGLHA.5700(a)TK2MSFTNGP04.phx.gbl... >> redbull wrote: >>> Hi guys, I've created a simple webpage with a datagridview, my >>> business object. >>> If i try to modify a record i get an error on date value: >>> >>> Dettagli eccezione: System.InvalidOperationException: Impossible to >>> convert the value of parameter 'DataNascita' from 'System.String' to >>> 'System.DateTime'. >>> What should I do? >>> Thanks >> >> You can't populate a DateTime value field or variable with string data >> representing a date and time. >> >> The string date and time must be converted over to System.Datetime >> before the field or variable can be populated by string data the >> represents a date and time. >> >> You should look up how to use the 'Convert' statement. > > > to insert the value i do: > persona.data= Convert.ToDateTime(Me.TextBox3.Text) > > The problem raises when i click on update dategridview.....but how can I > modify code related to selcet/update/insert in datagridview? > Thanks > > What is 'DataNascita', because that's what it doesn't like?
From: redbull on 3 Jul 2010 04:15
"Mr. Arnold" <Arnold(a)Arnold.com> ha scritto nel messaggio news:#8mdTghGLHA.5668(a)TK2MSFTNGP04.phx.gbl... > What is 'DataNascita', because that's what it doesn't like? db sqlserver 2008, datanascita means "birth date" and it is a date type on the db on the business object I have defined the property DataNascita like a datetime The problem is got when i call update function on datagridview.... |