I think you are using like textbox1.text as a value for the date object. If so do the below.
Better to use nullable type.
Ex:
DateTime? ordDate;
ordDate=TextBox OrdDate.Text;
then use this date1 object to insert into database like this.
string sqlInsert = "insert into orders(orderDat e) values('"+ordDa te+"');
I think it...
User Profile
Collapse
-
Hi ,
I don't know which platform you are using to develop your webpage.I give you sample code here to insert data into a sql server database table from an asp.net web page. I think this will help you.
----------------------------
Using System.Data.Sql Client
void Page_Load()
{
SqlConnection con=new SqlConnection ("server=labser ver;database=te stdb;username=s a;password=s");
...Leave a comment:
-
If you pass argument like '1,2,3,4' , the database will assume input as single element and it won't assume that the input is a collection of elements seperated by comma,
Please pass input like the above and user defined split method to split the elements....Leave a comment:
-
You can update your database with the database files in two ways.
1.Attach database
2.Restore database
You can use restore method to restore database backup file( dbbackup.bak) in you system.
.Restore Method.
1.Open Enterprise manager window.
1. Create an empty database(name should be same as name of the database do you want to restore in your machine).
2.Right click...Leave a comment:
No activity results to display
Show More
Leave a comment: