How To assign null value into nullable object
-
I have A TableAdapter and wana To assign Null value To It's Parameter I use Dbnull.value But I cant
-
I have A TableAdapter and wana To assign Null value To It's Parameter I use Dbnull.value But I cant
Without seeing the code that's having the problem and the error messages, it's pretty much impossible to tell you what you're doing wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Without seeing the code that's having the problem and the error messages, it's pretty much impossible to tell you what you're doing wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I have this code in as Procedure in SqlServer alter PROC Aut.SpGetArshive(@userId Int,@SecID bigint) AS BEGIN SELECT *,str(isnull(a.Row,0))+' '+a.Title+ ' ('+a.Zonkan+')' AS des FROM aut.Archive a WHERE (a.UserId IS NULL AND a.SecId=@secId) OR (a.SecId IS NULL AND a.UserId=@userId) END and have this table adapter in vb.net 2005 dataset SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, UserID, SecID) and I wana pass null value to userId but Icant I Use SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, dbnull.value, SecID) or SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, nothing, SecID) but there is Error tanx
-
I have this code in as Procedure in SqlServer alter PROC Aut.SpGetArshive(@userId Int,@SecID bigint) AS BEGIN SELECT *,str(isnull(a.Row,0))+' '+a.Title+ ' ('+a.Zonkan+')' AS des FROM aut.Archive a WHERE (a.UserId IS NULL AND a.SecId=@secId) OR (a.SecId IS NULL AND a.UserId=@userId) END and have this table adapter in vb.net 2005 dataset SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, UserID, SecID) and I wana pass null value to userId but Icant I Use SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, dbnull.value, SecID) or SpGetArshiveTableAdapter.Fill(Me.Ds.SpGetArshive, nothing, SecID) but there is Error tanx
How about a couple of examples of SQL stored procedure "optional paramters" -> http://weblogs.asp.net/rmclaws/archive/2004/02/18/75381.aspx[^], and http://sqlserver2000.databases.aspfaq.com/can-i-have-optional-parameters-to-my-stored-procedures.html[^]. The idea is to set the parameter to NULL (default value) inside the procedure, then just set the userID parameter in your code when you need to use it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
How about a couple of examples of SQL stored procedure "optional paramters" -> http://weblogs.asp.net/rmclaws/archive/2004/02/18/75381.aspx[^], and http://sqlserver2000.databases.aspfaq.com/can-i-have-optional-parameters-to-my-stored-procedures.html[^]. The idea is to set the parameter to NULL (default value) inside the procedure, then just set the userID parameter in your code when you need to use it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008tanx I changed my procedure .