473,394 Members | 1,770 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.

null in textbox

Hello,
a small problem. In a bound textbox I delete the contents and when I go to
another control de text reappears. No events and so on. The db column
accepts null. If the textbox is empty and I put something in, or change
something, no problem. Someone else had the same problem (read in some
newsgroup) and solved it because his databinding was screwy, no further
explanation. I use this (shortened version):

Dim kol As DataColumn
for each kol in ds.tables(0).columns
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)

Please advice
Thanks
Frank
Nov 20 '05 #1
8 1447

"Frank" <fr***@frank.com> ha scritto nel messaggio
news:ca**********@news5.tilbu1.nb.home.nl...
Hello,
a small problem. In a bound textbox I delete the contents and when I go to
another control de text reappears. No events and so on. The db column
accepts null. If the textbox is empty and I put something in, or change
something, no problem. Someone else had the same problem (read in some
newsgroup) and solved it because his databinding was screwy, no further
explanation. I use this (shortened version):

Dim kol As DataColumn
for each kol in ds.tables(0).columns
kol.AllowDBNull = true
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)

Nov 20 '05 #2
Hi Frank,

Have a look at an earlier message I sand about this.

http://groups.google.com/groups?selm...TNGP10.phx.gbl

I hope this helps?

Cor
a small problem. In a bound textbox I delete the contents and when I go to
another control de text reappears. No events and so on. The db column
accepts null. If the textbox is empty and I put something in, or change
something, no problem. Someone else had the same problem (read in some
newsgroup) and solved it because his databinding was screwy, no further
explanation. I use this (shortened version):

Dim kol As DataColumn
for each kol in ds.tables(0).columns
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)

Please advice
Thanks
Frank

Nov 20 '05 #3

"::P:e:s:c:e:::M:a:r:c:o::" <it***************@hotmail.com> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...

"Frank" <fr***@frank.com> ha scritto nel messaggio
news:ca**********@news5.tilbu1.nb.home.nl...
Hello,
a small problem. In a bound textbox I delete the contents and when I go to another control de text reappears. No events and so on. The db column
accepts null. If the textbox is empty and I put something in, or change
something, no problem. Someone else had the same problem (read in some
newsgroup) and solved it because his databinding was screwy, no further
explanation. I use this (shortened version):

Dim kol As DataColumn
for each kol in ds.tables(0).columns


kol.AllowDBNull = true
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)


objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)



"::P:e:s:c:e:::M:a:r:c:o::" , it's a bound column so that prop is already
set!!!!
Nov 20 '05 #4

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
Hi Frank,

Have a look at an earlier message I sand about this.

http://groups.google.com/groups?selm...TNGP10.phx.gbl
I hope this helps?

Cor
a small problem. In a bound textbox I delete the contents and when I go to another control de text reappears. No events and so on. The db column
accepts null. If the textbox is empty and I put something in, or change
something, no problem. Someone else had the same problem (read in some
newsgroup) and solved it because his databinding was screwy, no further
explanation. I use this (shortened version):

Dim kol As DataColumn
for each kol in ds.tables(0).columns
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)

Please advice
Thanks
Frank



Cor, very nice, but are you telling me there is no better (read: simpler)
solution? There must be, because, as I wrote, someone else solved it by a
change in his databinding.
Frank
Nov 20 '05 #5
Hi Frank,

I misreaded your question.
Dim kol As DataColumn
for each kol in ds.tables(0).columns
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)


Why is that objNew = New TextboxUser(kol)
I assume you want to set the databindings to an existing textbox so I would
expect something as
dim objNew as Textbox = TextboxUser(kol)

Just guessing I see to few now,

Cor
Nov 20 '05 #6

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
Hi Frank,

I misreaded your question.
Dim kol As DataColumn
for each kol in ds.tables(0).columns
objNew = New TextboxUser(kol) (my own userclass, inherits textbox)
objNew.databindings.add("Text", ds.Tables(0), kol.ColumnName)
next
myCM = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)
Why is that objNew = New TextboxUser(kol)
I assume you want to set the databindings to an existing textbox so I

would expect something as
dim objNew as Textbox = TextboxUser(kol)

Just guessing I see to few now,

Cor


Cor,
there is a dim: dim objNew as object. But it doesn't show in this small
piece of code.
I don't think u misread the question, because your solution probably works.
But it's a lot of work for something that looks like a bug. If the dbcol is
varchar or so, then this behaviour does not occur.
I'm still researching and so far I discovered that at the end of the
validating event, the old contents are put back into the textbox.
Regards
Frank
Nov 20 '05 #7
Hi Frank,

Not the dim, the New is what I tried to show you.
You are setting references to an existing textbox I assume.

Cor
Nov 20 '05 #8

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Hi Frank,

Not the dim, the New is what I tried to show you.
You are setting references to an existing textbox I assume.

Cor


I don't know what u mean, everything works fine except the appearance of
deleted numbers.
Doesn't matter, I used your method. Wasn't much work because I only had to
program it in my usertextboxclass (which inherits textbox). But I still
think this is a bug.
Thanx
Frank
Nov 20 '05 #9

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

Similar topics

2
by: WhiskyRomeo | last post by:
I have a bound textbox (bindings are set at design time) to a dataset column. Sometimes the value of this textbox must be set so that the underlying database field gets updated to null when using...
3
by: Paul T. Rong | last post by:
Do "" and Null both mean nothing?¡¡ If I don't type anything in text box, the its value is Null£¿¡¡Or it is ¡°¡±£¿ I don¡¯ think they are the same, but I don¡¯t know their difference. Thanks.
6
by: Dean Slindee | last post by:
I am looking for the "right" way to handle inserting and presenting null date values. Public Const c_NullDate As Date = #12:00:00 AM# If I set the value of a date variable in an SQL Server insert...
10
by: Sandy | last post by:
I have a bunch of textboxes that it is all right for them to be null How do I program that? I keep getting an error that says Null is no longer supported Sandy
7
by: Mirek Endys | last post by:
Hello, the problem I have now, is: Im binding generic collection based on List<iDB2SQLTransferItem> // iDB2SQLTransferItem is my class // into WebCOntrol DataList. But the DataItem of the...
17
by: NuB | last post by:
I have a sql query that is doing an update of records, how can I add NULL to the field in the database if the field on my screen is blank? example: I have 5 textboxes, and a user can leave some...
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....
2
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
3
by: BD | last post by:
I have sent several posts on this topic and feel my lack of information is not helping to find the solution. I am developing application in C# with Visual Studio 2005 to connect with remote SQL...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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...

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.