Hi,
That can be done easily. Moreover you can use the code on
line no 13. But in that case, when u use Delete.aspx, you can access
the query parameters like this:
Request.QueryString["ProductID"]
Remember that you will always get string in return. In case you want to use it as integer, you'll have to parse it.
There are many ways of converting this code. I am jotting down the simplest way of doing it, as it is written in PHP (just changing the syntax) (Assuming that you'll be using SQL Server).
On Page_Load function :
StringBuilder content = new StringBuilder();
content.Append("<TABLE BORDER=2> <TR><TD>Full Name<TD>Nick Name<TD>Options</TR>");
SqlConnection con = new SqlConnection("server=localhost;user=tushar;password=pwd;database=asp");
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = " Select * from personnel";
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
content.Append("<TR><TD>" + reader["FirstName"].ToString() + reader["LastName"].ToString() );
........
........
}
content.Append("</table>");
reader.Close();
con.Close();
Response.Write(content.ToString());
I hope this helps.
Regards,
Tushar