473,394 Members | 1,721 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,394 software developers and data experts.

Textbox and binding DbNull Values

When I bind a textbox to a typed dataset column that allow null values
(DataType=Decimal), If I enter nothing in the textbox, it doesn't accept the
new value and it goes back to the previous value. Only if the previous value
is nothing it accepts enter nothing.
I have VS.NET2003.

What can I do??

Regards,
Juanjo.

Jul 21 '05 #1
1 2411
Hi Junajo

I believe you are trying to insert null values into table.
If you are using stored procedures (sql server) you could do like thi
Declare @closed_date_time datetim
if Len(LTrim(Rtrim(@closed_date))) >
BEGI
SET @closed_date_time=Convert( datetime,@closed_date,103
EN
els
BEGI
SET @closed_date_time= NUL
EN

and insert @closed_date_time into your table

If you are trying to retrieve null value into your text box you coul
If Not (IsDBNull(dataset.Tables(0).Rows(0).Item("field name"))) The
txtClosedDate.Text = dataset.Tables(0).Rows(0).Item("field name"
End I
though this is better handled in query itsel

Regard
Satish
Jul 21 '05 #2

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

Similar topics

0
by: Neil Young | last post by:
Hello group, I'm referring to a "rather old thread" (April 21st 2005). Because I also ran into problems with ASP.NET 2.0 formview and DBNull, but found a way around, I would like to share my...
1
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. ...
1
by: Agnes | last post by:
In my tables, there are invoicedate, as i use databinding, bind the invoicedate to the textbox, It show mm-dd-yyyy time. I need to change it into date dd-mm-yyyy only without time . how can i do...
13
by: Agnes | last post by:
I know someone post the solution before, but I didn't keep in mind . So I am sorry to ask the same question again I had bind a datatime to the textbox name txtInvoice I want it displayed in...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
1
by: Juanjo | last post by:
When I bind a textbox to a typed dataset column that allow null values (DataType=Decimal), If I enter nothing in the textbox, it doesn't accept the new value and it goes back to the previous value....
2
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's...
3
by: Mike T | last post by:
I'm having a problem with the new ASP.NET 2.0 SqlDataSource object. (my first time using it) I placed a SqlDataSouce object on the page and set its connection properties in the Web.Config. ...
1
by: Brad Pears | last post by:
I am using vb.net 2005 and SQL server 2000. In my table I have a date field of type "smalldatetime". In my vb application, the user may or may not enter a date value into the appropriate text box....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
jinu1996
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...
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
tracyyun
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 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.