Hi
vb2005/sqlserver2005. I have a stored procedure that accepts three optional
parameters. If I run the following it returns the data fine;
DECLARE @return_value int
EXEC @return_value = [dbo].[NewSelectCommand]
@CompanyType = NULL,
@Status = NULL,
@BusinessDivision = NULL
If however I use the following in my vb.net app, I get nothing.
Me.CompaniesTableAdapter.Fill(Me.EMSDataSet.Compan ies,
DBNull.Value.ToString, DBNull.Value.ToString, DBNull.Value.ToString)
What is the problem and how can I fix it?
Thanks
Regards 4 1912
Try using System.Data.SqlTypes.SqlString.Null for your parameter values. If
your parameters are not strings there are additional types in the SqlTypes
namespace for the different SQL data types.
--
Thanks
Dan Jurden
"John" wrote: Hi
vb2005/sqlserver2005. I have a stored procedure that accepts three optional parameters. If I run the following it returns the data fine;
DECLARE @return_value int EXEC @return_value = [dbo].[NewSelectCommand] @CompanyType = NULL, @Status = NULL, @BusinessDivision = NULL
If however I use the following in my vb.net app, I get nothing.
Me.CompaniesTableAdapter.Fill(Me.EMSDataSet.Compan ies, DBNull.Value.ToString, DBNull.Value.ToString, DBNull.Value.ToString)
What is the problem and how can I fix it?
Thanks
Regards
John (Jo**@nospam.infovis.co.uk) writes: vb2005/sqlserver2005. I have a stored procedure that accepts three optional parameters. If I run the following it returns the data fine;
DECLARE @return_value int EXEC @return_value = [dbo].[NewSelectCommand] @CompanyType = NULL, @Status = NULL, @BusinessDivision = NULL
If however I use the following in my vb.net app, I get nothing.
Me.CompaniesTableAdapter.Fill(Me.EMSDataSet.Compan ies, DBNull.Value.ToString, DBNull.Value.ToString, DBNull.Value.ToString)
What is the problem and how can I fix it?
I don't really know what DBNull.Value.ToString() returns, but it is
not likely to be a NULL value. My guess goes for the string "NULL" which
is something completely different.
In any case, you desperately need to be more discriminate in your selection
of newsgroups, or else people will grew tired of you quickly.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ESPNSTI |
last post by:
Hi,
Please don't shoot me if the answer is simple, I'm new to .Net and C# :)
..
I'm attempting to convert a nullable type to it's "non-nullable" type in a
generic way (without knowing what...
|
by: Mark Rae |
last post by:
Hi,
In v1.1 I used to simulate nullable datatypes with structs. e.g.
public struct NullableString
{
private readonly String pstrValue;
private readonly bool blnHasValue;
public...
|
by: Joe Bloggs |
last post by:
Hi,
Can someone please kindly show me how to determine if a type (read value
type) is Nullable.
MSDN has this KB:
How to: Identify a Nullable Type (C# Programming Guide)...
|
by: rascal_mon |
last post by:
I'm new with XML. Please give me some advice.
I wonder there are any difference between XML that is automatically generated
from ADO and XML file that shows in many textbooks. I found that the...
|
by: MLM450 |
last post by:
Is there a way to get the address of the underlying value of a nullable
variable without copying the value? I tried the following, but the
compiler doesn't like it. I need to do this because I am...
| |
by: Goofy |
last post by:
The 2.0 Framework has a new type called System.Nullable. This allows
something to Not exist, basically you can pass 'Nothing' to a method whose
parameters as System.Nullable.
Im looking at table...
|
by: =?Utf-8?B?VGVycnk=?= |
last post by:
I have a generic function I am using to check constraints, an example of
which is the following:
Public Function ValidateMinValue(Of t As IComparable)(ByVal PropertyName As
String, ByVal value...
|
by: =?Utf-8?B?V2FubmFiZQ==?= |
last post by:
I have a start and end date in my application. If a user does not know their
dates yet, I want them, they will be null in the DB and I want them to be
blank in the application. So, I'm trying to...
|
by: Tony Johansson |
last post by:
Hello!
These two declarations(1 and 2) are the same I assume.
1. System.Nullable<intnullable;
2. System.Nullable<intnullable = new System.Nullable<int();
So because these 1 and 2 are the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |