Click here to Skip to main content
15,898,373 members

Comments by Member 11796666 (Top 11 by date)

Member 11796666 12-Jul-15 10:56am View    
Dear Phil.o
When I used the query("OW_NUMBER() OVER (ORDER BY t.Score DESC) AS Rank") in my webform, a problem is occured with my e.commandargument. It was arranged (0-1-2-3-...). In fact, e.commnadargument should be depends on clicking mouse click on the gridview column(as TemplateField which is binded to my table).
Member 11796666 12-Jul-15 7:50am View    
Dear Phil.o
It is Microsoft SQl Serevr 2008
Member 11796666 11-Jul-15 17:39pm View    
Dear ....
I used this and it was useful but there is an error as below:
"THE OVER SQL construct or statement is not supported"
but an additional column(1-2-3-...) is added to my table in sql.
what about the error?
best wishes
Member 11796666 11-Jul-15 4:51am View    
protected void Button1_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(ViewState["id"]);
SqlConnection con = new SqlConnection()
//con.ConnectionString = "";
string q = "update ooo set title=@title where id=@id";
SqlCommand cmd = new SqlCommand(q, con);
cmd.Parameters.Add("@id", id);
cmd.Parameters.AddWithValue("@title",TextBox1.Text);
cmd.Parameters.AddWithValues("@title1",TextBox2.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
}
Member 11796666 11-Jul-15 4:49am View    
Dear Richard
To complete the program, It is enough to add these;
TextBox2.Text = dr["title1"].ToString();
cmd.Parameters.AddWithValue("@title",TextBox2.Text);
best wishes