Hello to all,
I am making an ASP.NET web application.
I am using the rad grid of telerik. In that grid I am also saving the path of image as i make a directory in which the images are saving and also images are saving in database.
Now i want that image should be visible in the grid but its not happening. On insert i am doing this.
protected void radgrid_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item;
string txtmodalname = (insertedItem.FindControl("txtmodalname") as RadTextBox).Text;
string txtqty = (insertedItem.FindControl("txtqty") as RadTextBox).Text;
string txtprice = (insertedItem.FindControl("txtprice") as RadTextBox).Text;
string category = (insertedItem.FindControl("cmbcategory") as RadComboBox).Text;
string subcategory = (insertedItem.FindControl("subcategory") as RadComboBox).Text;
RadUpload upload = (insertedItem.FindControl("RadUpload1") as RadUpload);
string file = upload.UploadedFiles[0].FileName;
int maxid = 0;
SqlCommand cmd1 = con.CreateCommand();
cmd1.CommandText = "select isnull(max(id),0) from itemadd";
SqlDataReader dr1;
dr1 = cmd1.ExecuteReader();
while (dr1.Read())
{
maxid = int.Parse(dr1.GetInt32(0).ToString());
}
maxid = maxid + 1;
if (upload.UploadedFiles.Count > 0)
{
string filename = upload.UploadedFiles[0].FileName;
}
string value = maxid + "," + txtmodalname + "," + category + "," + subcategory + "," + txtqty + "," + txtprice + "," +file ;
ExecuteSP("id,modelname,category,subcategory,quantity,price,fileupload", value, "insertitem");
}
Please tell what will i have to do in design as well as in coding? whether i will have to save in this way to retrieve or any other way is there?