D
Doug
Hi
I posted an hour ago from a different pc - about calling a form from another
form.
now i am having trouble passing the value from a text box (called
tb.entryData), from the form called input.cs (referenced as an object as
input simple=new input() to my select string.
My code is below
private void btnSimple_Click(object sender, EventArgs e)
{
lbCustomers.Text = "";
input simple = new input();
simple.Show();
// simple has a text box and a button. The text box is called tb.entryData
and its value is passed to a public string called inputs
// i would like the value passed into the commandString to use as a querie.
string commandString = "SELECT vars.label, vars.file, vars.wave, vars.name
FROM vars where var.label like '%' + simple.inputs";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\hilda helpa - confidentialised.mde";
OleDbDataAdapter DataAdapter = new OleDbDataAdapter(commandString,
connectionString);
DataSet DataSet = new DataSet();
try
{
DataAdapter.Fill(DataSet, "vars");
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex);
return;
}
DataTable dataTable = DataSet.Tables[0];
foreach (DataRow dataRow in dataTable.Rows)
{
lbCustomers.Items.Add(dataRow["file"] + " " + dataRow["name"]+ " " +
dataRow["label"] +" " + dataRow["wave"]);
}
}
Any assistance appreciated.
Doug
I posted an hour ago from a different pc - about calling a form from another
form.
now i am having trouble passing the value from a text box (called
tb.entryData), from the form called input.cs (referenced as an object as
input simple=new input() to my select string.
My code is below
private void btnSimple_Click(object sender, EventArgs e)
{
lbCustomers.Text = "";
input simple = new input();
simple.Show();
// simple has a text box and a button. The text box is called tb.entryData
and its value is passed to a public string called inputs
// i would like the value passed into the commandString to use as a querie.
string commandString = "SELECT vars.label, vars.file, vars.wave, vars.name
FROM vars where var.label like '%' + simple.inputs";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\hilda helpa - confidentialised.mde";
OleDbDataAdapter DataAdapter = new OleDbDataAdapter(commandString,
connectionString);
DataSet DataSet = new DataSet();
try
{
DataAdapter.Fill(DataSet, "vars");
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex);
return;
}
DataTable dataTable = DataSet.Tables[0];
foreach (DataRow dataRow in dataTable.Rows)
{
lbCustomers.Items.Add(dataRow["file"] + " " + dataRow["name"]+ " " +
dataRow["label"] +" " + dataRow["wave"]);
}
}
Any assistance appreciated.
Doug