mardi 5 avril 2016

generate random questions in data grid view windows form application c#

i want to generate random question on button click and want to show these random question in message box or other form that's why i used query to generate random question but when i click on random button it doesn't respond. give solution for this. thanks here is my code.

       string str = "SELECT  Name FROM STD WHERE (ABS(CAST((BINARY_CHECKSUM(*)  RAND()) as int)) % 100) < 10";

        SqlCommand cmd = new SqlCommand(str, con);
        SqlDataAdapter sda = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        sda.Fill(ds);




Aucun commentaire:

Enregistrer un commentaire