inserting textbox values into database

前端 未结 6 1027
陌清茗
陌清茗 2020-12-16 07:57

im a newbie here and would like some advice on C# programming

i would like to store values from a textbox into a database. so far, i have the following:

<         


        
6条回答
  •  孤街浪徒
    2020-12-16 08:15

    if your ProjectStartDate and dates in general are datetime values in the DB, then you will get an error when inserting data with the '. It should be like:

    String thisQuery = "INSERT INTO ProjectList (ProjectName, BiddingDueDate, Status, ProjectStartDate, ProjectEndDate, AssignedTo, PointsWorth, StaffCredits) VALUES ('"+projName+"', "+bidDueDate+", '"+status+"', "+projectStartDate+", "+projectEndDate+", '"+assignedTo+"', '"+pointsWorth+"', '"+aStaffCredits+"')"; 
    

提交回复
热议问题