Please post your code. Without it, it's hard to impossible to help you.
Hi,
This is my code..
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class NewCategories : System.Web.UI.Page
{
public string cid;
public string cname;
string description;
private SqlConnection con;
string connection = ConfigurationManager.AppSettings["connection"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
try
{
string qstring = Request.QueryString[0].ToString();
string[] qryarr = new string[1];
int index = qstring.IndexOf(',');
int len = qstring.Length;
int leng = len - (index + 1);
cid = qstring.Substring(0, index);
string restValues = qstring.Substring(index + 1, leng);
int indexrestofvalues = restValues.IndexOf(',');
int lengthrestofvalues = restValues.Length;
int lencname = lengthrestofvalues - indexrestofvalues;
cname = restValues.Substring(0, indexrestofvalues);
description = restValues.Substring(indexrestofvalues + 1, lencname - 1);
txtCatID.Text = cid;
txtName.Text = cname;
txtDescription.Text = description;
txtName.Text = txtName.Text;
txtDescription.Text = txtDescription.Text;
}
catch (Exception)
{
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow r = GridView1.Rows[e.RowIndex];
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string status;
//GridView1.DataBind();
con = new SqlConnection(connection);
con.Open();
status = con.State.ToString();
string a = txtName.Text;
txtName.Text = a;
SqlCommand cmd1 = new SqlCommand("update Categories set CategoryName='" + txtName.Text + "',Description='" + txtDescription.Text + "' where CategoryID=" + cid + " ", con);
cmd1.ExecuteNonQuery();
con.Close();
GridView1.DataBind();
//}
}
}