mahmud_uk

mahmud_uk

  • NA
  • 48
  • 0

SQL string

Jul 27 2004 9:19 AM
Hi guys, I've created this string where it displays a list from the database depending on the text being submitted. What i'm trying to do now, is catch an logon error where if the text entred is not match with the database, it will need to return a error on a message.box telling them its incorrect name or user id. Its basically a logon page, where users will need to get authenticated through the database. SqlCommand thisCommand = da.CreateCommand(); DataSet ds = new DataSet(); // Console.WriteLine (sQuery); // to get the query for debug, you can try execute this query in sql query analyser sqlDataAdapter1 = new SqlDataAdapter("SELECT * FROM License WHERE Name = '"+ textBox1.Text +"' AND ContentOwnerID = '"+ textBox2.Text +"'", da); sqlDataAdapter1.Fill(ds, "License"); dataGrid1.DataSource = ds.Tables["License"].DefaultView; Thank, Les

Answers (1)