473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VB.NET Null to SQL Null (ASP.NET 2.0 GridView)

Hey,

I have everything working now except for this. I have some fields that
I am getting data from, then I am sending them to a SQL database. Now
the empty string and VB.NET null are different than the SQL Null (type:
"System.DBNull"). So, i need some way of cenverting the values into a
"System.DBNull" object and then send them to the database. Any ideas?

BTW: The parameter called: "ConvertEmptyStringToNull" does not work.
Microsoft said there is a bug and it will be fixed for the release
date.

Thanks,
Kivak Wolf

Nov 19 '05 #1
2 1574
One option is to create your own wrapper and have it take the VB Null and
make it a SQL null. This will allow you to switch to
ConvertEmptyStringToNull() when it is fixed without having a major
application rewrite (change in your wrapper method only).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Kivak Wolf" wrote:
Hey,

I have everything working now except for this. I have some fields that
I am getting data from, then I am sending them to a SQL database. Now
the empty string and VB.NET null are different than the SQL Null (type:
"System.DBNull"). So, i need some way of cenverting the values into a
"System.DBNull" object and then send them to the database. Any ideas?

BTW: The parameter called: "ConvertEmptyStringToNull" does not work.
Microsoft said there is a bug and it will be fixed for the release
date.

Thanks,
Kivak Wolf

Nov 19 '05 #2
I understand that is what I have to do. It is just a matter of
implementing it. I have no idea how to do it because I don't know how
to access the data members in the GridView.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason Huang | last post by:
Hi, How to we tell if a DataSet is null in a ASP.Net C# Windows Form? Is it possible that a DataSet is not null but has no DataTable? What will be the simplest code? Thanks for help. Jason
0
by: Richard | last post by:
Hi there, Can somebody point me to the right direction please? I want to edit fields in sql, but instead of using: <asp:CommandField ShowHeader="true" HeaderText="Edit" ShowEditButton="true" />...
7
by: WayDownUnder | last post by:
Hello, I have a gridview control bound to a objectdatasource. The primary key column is on the grid but made visible = false. Because the column is invisible I cant get to the cell value when the...
4
by: WayDownUnder | last post by:
I am trying to findout which column the user clicked on in a gridview. column 0 = CommandField ( view) column 1 = CommandFiled ( edit) When the event grdTemp_SelectedIndexChanged occurs on...
9
by: ghostwolf | last post by:
Hi, I want to hide a column in the asp:GridView, say one of the column of asp:BoundField. But it is not allowed to put <divinside for setting it display:none. What can I do? Thanks in millions.
4
by: saturnius | last post by:
Hello, I have to save the data from a gridview as XML file. The code is shown below. Is there no easier way? I would like to access either asp:SqlDataSource (me.SqlDataSource1.something) or...
0
by: Mat | last post by:
Is it possible to call a vbscript function from the gridview's properties (like the TEXT propertie)?
0
by: jumpinjavabean | last post by:
I have an (ASP.NET 2.0) asp:GridView control and I want to be able to control the relative display position of each column. For example, let's say I have four columns in the datasource and I want...
1
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have a <asp:GridViewcontrol that is populated with records. The first column I display contains a "UserID" DataField. I've created my column using the following code: <asp:BoundField...
5
AnuSumesh
by: AnuSumesh | last post by:
Hi All, I am using <asp:Gridview> to display my data. I am adding columns and rows dynamically. I am facing following issues: 1. I want scrollbars around the gridview and for this purpose i...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
agi2029
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.