It's been 24 hours, I'm a newbie so please be patient with me. I'm trying to pass a parametor from a textbox to a SQL Store Procedure to generate dataset to populate datagrid on a form in a windows application.

I found an example of someone using what i believe is C++ but I need to do mine in C#, I got to transalate all the code except the last part. this is my code:

private void btnSearch_Click(object sender, System.EventArgs e)
{

SqlConnection thisConn = new SqlConnection();
thisConn.ConnectionString = @"Data Source=(local);Integrated Security=SSPI;" + "Initial Catalog=HS00749";
SqlCommand thisCommand = new SqlCommand("CustomerPhoneNumber", thisConn);
thisCommand.CommandType = CommandType.StoredProcedure;
thisCommand.Connection = thisConn;
//Create DataAdapter object for update and other operations
SqlDataAdapter thisAdapt = new SqlDataAdapter();
thisAdapt.SelectCommand = thisCommand;
SqlParameter phoneNumber = new SqlParameter("@PhoneNumber", SqlDbType.NVarChar);
phoneNumber.Direction = ParameterDirection.Input;
thisCommand.Parameters.Add(phoneNumber);
phoneNumber.Value = this.txtCustomerPhoneNumber.Text;
thisAdapt.Fill(this.dsCustomerPhoneNumber1,"cpn");
this.dgResults.DataSource = this.dsCustomerPhoneNumber1.Tables;
this.dgResults.DataBindings.
}

The last part of this example i found on somewhere goes like this:

DataGrid1.DataBind()

this line is suppose to go after the last line of my code (this.dsCustomerPhoneNumber1.Tables) but in c# there's no DataBind but DataBindings which only lets me bind to one of my columns in my dataset and it's not a method like that nice DataBind().

Currently the error a i get is:

Complex DataBinding accepts as a data source either an IList or an IListSource

so the binding part of my dataset to my datadrid is what I think is causing this??

any ideas?

Thanks in advance!!

Francisco.