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

datatable defaultvalue changed programmatically

nev
251 100+
my datatable column defaultvalue depends on what is displayed on a textbox. but i noticed that you can only set the defaultvalue once because when i set it again, the defaultvalue remains the same as what i set as a defaultvalue in the beginning.

how will i get this to work? i want the defaultvalue of my datatable to change to what is placed in my textbox.
Nov 19 '07 #1
5 2138
Shashi Sadasivan
1,435 Expert 1GB
you have to issue the Update command if you want to save any changes!

Is this a windows form or asp .net application?
Nov 19 '07 #2
nev
251 100+
you have to issue the Update command if you want to save any changes!

Is this a windows form or asp .net application?
thank you for your reply. i'll try it at once! its a windows form :-)
Nov 19 '07 #3
nev
251 100+
it doesn't work

the defaultvalue still remains unchanged

dtt.column.defaultvalue = "hello" 'this is ok

when i add new in the datagridview, the column automatically displays "hello" as the default value.

then i do another dtt.column.defaultvalue = "world" 'this is not ok

when i add new in the datagridview, the column still automatically displays "hello" as the default value and not "world".

how do?
Nov 19 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
are you setting the default values programatically or in the design mode (ie in the dataset file)

if you are doing programatically please make sure that you remove all instances where you set the default value to "hello"
Nov 19 '07 #5
nev
251 100+
ohhhh, hohoho! it works! i just forgot to assign the second value in my code :-) hohoho! merry christmas!
Nov 19 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Plumer | last post by:
Good morning everyone Using C# I create a bog-standard System.Data.DataTable which I then Add to a System.Data.Dataset (At the moment I'm in the guess-and-test phase so the table has only one...
0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
4
by: Rob Kroese | last post by:
I've got a form with a datagrid that displays a list of items, along with several textboxes, comboboxes, etc., that display the details for the selected item. The columns in the datagrid and the...
2
by: nate axtell | last post by:
After binding a DataGrid and a few TextBoxes to the same DataTable in VB ..NET I successfully see the TextBoxes update when I change the selection in the DataGrid. I put DataGrid1.Invalidate() in...
1
by: Vik | last post by:
I use a dataadapter to create a datatable and retrieve/update data in SQL Server database. But the datatable does not receive the default values from a server table and the new records don't...
4
by: SteveT | last post by:
I have a boolean property that I want to serialize to disk using XmlSerializer. I noticed that if the property includes the attribute "DefaultValue(true)" or "DefaultValue(false)" that the...
2
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
How can I reconcile changes between two data table and create a subset of those changes. I have two data tables with same schema which gets populated from two different xml files. I want to get...
5
by: =?Utf-8?B?S3VuYWwgUGF0ZWw=?= | last post by:
I have a DataTable with Column DataType as Double I just want to show data in C# datagrid with two decimal places which property do I set for DataColum of DataTable and How? Thanks
5
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.