Reputation:
i have put the following code in .aspx
<asp:TextBox ID="txtyourwords" runat="server" Rows="1" TextMode="MultiLine">
</asp:TextBox>
SqlCommand cmd = new SqlCommand("Insert INTO planning_t (date,course,planning) values("+Calendar1.SelectedDate.ToShortDateString()+","+DropDownList2.SelectedItem.Text+","+txtyourwords.Text.ToString()+" )", con);
now i want to insert the contents of textbox--(txtyourwords) into a table... what will be code in C# for .cs file. and datatype for this column is varchar(MAX).
Upvotes: 1
Views: 932
Reputation:
SqlCommand cmd = new SqlCommand("Insert INTO planning_t (date,course,planning) values('"+Calendar1.SelectedDate.ToShortDateString()+"','"+DropDownList2.SelectedItem.Text+"','"+txtyourwords.Text.ToString()+"' )", con);
Upvotes: 1