I have a textbox(Nume) and I do a search in oracle sql database and display it in crystal report. The question is how can I search from another one column and display it. Like name and prename in the same textbox (search multiple strings in multiple columns), in my situation from nume and prenume.
OleDbConnection con = new OleDbConnection("Provider=MSDAORA;Data Source=desktop-2hiivbv;Persist Security Info=True;Password=*****;User ID=STUDENT");
OleDbDataAdapter da;
DataSet ds;
public string strSQl;
protected void Cauta_Click(object sender, EventArgs e)
{
try
{
strSQl = "select * from angajati where nume ='" + this.ToTitleCase(Nume.Text) + "'";
da = new OleDbDataAdapter(strSQl, con);
ds = new DataSet();
da.Fill(ds, "angajati");
}
catch (Exception ex)
{
// MessageBox.Show(ex.Message.ToString());
}
CrystalReport raport = new CrystalReport();
raport.SetDataSource(ds.Tables["angajati"]);
CrystalReportViewer1.ReportSource = raport;
}
the table is this
CREATE TABLE angajati (
nr_crt int primary key,
nume varchar(20) not null,
prenume varchar(20) not null
)