SqlConnection con = new SqlConnection("Data Source=NSYS1\\SQLEXPRESS;Initial Catalog=agfl;connect timeout=30;Integrated Security=True"); con.Open(); string strQuery = "select * from stf where rdate =@some"; SqlCommand cmd = new SqlCommand(strQuery, con); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@some", TextBox6.Text); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); gvuser.DataSource = dt; gvuser.DataBind(); con.Close();
select *,convert(varchar(10),rdate,103) as rdate1 from stf where rdate =@some
<asp:boundfield datafield="Your_Date_Column" dataformatstring="{0:MMMM d, yyyy}" htmlencode="false" xmlns:asp="#unknown" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)