Add connection string in your web.config file like:
<add name="MyConnectionString" connectionString="Data Source=ServerName;initial catalog=DatabaseName;Integrated Security=True;" providerName="System.Data.SqlClient" />
Update your code to:
SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
con.Open();
string strQuery = "select * from stv where rdate = @rdate";
SqlCommand cmd = new SqlCommand(strQuery, con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@rdate", TextBox6.Text);
DataSet ds = new DataSet();
sda.Fill(ds);
DataTable dt = new DataTable();
dt = ds.Tables[0];
gvuser.DataSource = dt;
gvuser.DataBound();
con.Close();
It worked for me. Check if it works for you too.