Hi folks....I'm back,
After searching and trial and error, I've hit a brick wall.
I want to add a Public Variable as the DefaultValue of a Column in a new DataRow.
In the DataSet Designer Properties, how do you insert a variable name into the field for DefaultValue
Is this possible or are you constrained to putting only a String in as DefaultValue
Thanks much.

How do you add a variable as DefaultValue in Designer View
Ryan Milligan
hi,
open your double click your dataset in solution explorer, and select any column from your table , go to properties
you will find datatype property and default value property, set the default value depending on the datatype if its string type column make your default value string, if its integer type column make your default value integer
if you want to do that programmaticly in your form load event handler add something like this
Me.DataSet1.Tables("tableName").Columns("columnName").DefaultValue = Variable;hope this helps
DeadLine
Thanks Shakalama,
I tried something similar to your line before and it didn't work. I just tried your line and it works.
I just tried the line I wrote before and it also works. I must've had something screwed up somewhere else for it not to work the first time.
Here's the line I wrote first and it works:
Me.PartsDataSet.Manufacturers.PartNumberColumn.DefaultValue = mainPartNumI seem to remember that to put a variable in the Properties list in Designer view, you have to put something else with the variable such as:
For example.....variable partNum would need something like
%partNum% if you add a variable in the Designer View Properties list.
Is this not true
Many thanks.
Martin Ennemoser
hi,
may be you used the dataset object (the in solution explorer not the instance in your form) and that will not give you the same result , to select the instance in your form simply put Me. at the beginning
i didn't do something like this b4"%var%", but i don't think you can do something like this, actualy i would prefer to write the code in the form load event
hope this helps