I have a textbox and a calendar extender, here’s the code in page Default.aspx:
<asp:TextBox ID="tbdate" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="tbdate"
Format="dd.MM.yyyy">
</asp:CalendarExtender>
Now in Default.aspx.cs page I try to insert the value from the TextBox in new columns from DataTable
dt.Columns.Add("date", typeof(string), tbdate.Text);
and I have this error
Cannot interpret token ‘.’ at position 6.
I assume that you don’t want to add this date-value as
DataColumnbut asDataRow:By the way, the overload of
DataColumnCollection.Addthat you’ve used is for anExpression.If you want to add this value to all rows: