c# - String or binary data would be truncated. The statement has been terminated?8 -
c# - String or binary data would be truncated. The statement has been terminated?8 -
i trying save image file on db in binary format. using info set write insert query. beginner don't know how utilize these things. while using given below code errors. are: string or binary info truncated. statement has been terminated
please help me.
code:
protected void btnsubmit_click(object sender, eventargs e) { dataset1tableadapters.tbl_emptableadapter adp1; adp1 = new dataset1tableadapters.tbl_emptableadapter(); adp1.getinsert(txtempname.text,fileupload1); }
source:
<asp:textbox id="txtempname" runat="server"></asp:textbox> ✶</td> <asp:fileupload id="fileupload1" runat="server" /> <asp:button id="btnsubmit" runat="server" text="submit" onclick="btnsubmit_click" />
insert query:
insert tbl_emp (empname, emppic) values (@empname,@emppic)
data base:
try storing fileupload.filebytes
instead of entire upload control.
and prevent next question: please alter column type varbinary(max)
able store files larger 50 bytes.
c# asp.net database image
Comments
Post a Comment