Sunday, 15 July 2012

asp.net - Combining 'AND , 'OR' in Select statement -


Student name: When the user enters the ID or name and clicks on the button, the details should be defective. ... how?

Do not work here in my selection or section: PublicValue StudentView: System.Web.UI.Page {SqlConnection Thief = New SqlConnection ( WebConfigurationManager.ConnectionStrings ["DBCS"] ConnectionString). Protected Zero Button1_Click (Object Sender, EventArgs e) {String str = "Select Register.UsrFLname, Registration.UsrAddress, Students.STUID, Materials.BookID, Materials.BookName, Courses.CourseName, Courses.CourseFee Course on the inner course Include content. BookID = Materials.BookID join interiors at Courses.STUID = Students.STUID and Materials.STUID = Students.STUID Intermediate Students.STUID = Registration.STUID and Registration.UsrFLname = '' + TextBox1.Text + ' 'Join the enrollment student or student STUID =' "+ Text box 1. Text "" "; con.Open (); SqlCommand CMD = New SqlCommand (str, con); SqlDataAdapter da = New SqlDataAdapter (cmd); Dataset DS = New Dataset (D); Fill (DS, ARR); GDStudents DataSource = DS; GDStudents.DataBind ();

Anyone can help on this issue !!

Thanks in advance!

and have priority over or .

In the boolean argument AND > you should use the parentheses () .

or Ie

  2 * 3 + 1 = 7 2 * (3 + 1) = 8   

I think in your case, status

  Students.STUID = Registration STUID and note (- note that this bracket Registration.UsrFLname = '' + TextBox1.Text + '' or Students.STUID = '' + TextBox1.Text + '' ") - Note this pan   

The number of people who have noted, you should parameter your questions, and end the text given by the end user. Should not be compacted.

No comments:

Post a Comment