Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 434.9k

What is the problem of searching Informaton in my code?

Jul 5 2014 10:04 AM
My code:

public DataTable SearchStudent_Number()
{
Connection C1 = new Connection();
return C1.ShowData("select * from Student where Student_Number like '" + this.Student_Number + "%'");
}

public DataTable SearchAverage()
{
Connection C1 = new Connection();
return C1.ShowData("select * from Student where Average like '" + this.Average + "%' ");
}

public DataTable SearchLastName()
{
Connection C1 = new Connection();
return C1.ShowData("select * from Student where LastName like '" + this.LastName + "%'");
}

public DataTable SearchField()
{
Connection C1 = new Connection();
return C1.ShowData("select * from Student where Field like '" + this.Field + "%'");
}
public DataTable SearchStudent_ID()
{
Connection C1 = new Connection();
return C1.ShowData("select * from Student where Student_ID like '" + this.Student_ID + "%'");
}
}
}

Answers (4)