|
-
Sep 24th, 2008, 06:45 AM
#1
Thread Starter
Junior Member
[RESOLVED] Select random field with No index
Hi
I have a sqlserver table and a select statment. With the result of the sql stayment i want to select a random register. How can i achive that if i don't have a index field?
Thank you
There is my statment code
Dim connection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\novapastavb\novapasta.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
Dim command As New SqlCommand("SELECT count(login) as reclames FROM login where login=@nome and passe=@passe", connection)
command.Parameters.AddWithValue("@nome", TextBox1.Text)
command.Parameters.AddWithValue("@passe", TextBox2.Text)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader
While reader.Read()
MessageBox.Show(String.Format("Existem Muitos clientes Nome {0} ", reader("reclames")))
End While
reader.Close()
connection.Close()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|