Hello
The project is running succesfuly when i wrote in textbox "20". But
when i wrote there a float value like "20,1" or "20.1" the gridview doesn't bind. I checked the
code with breakpoint. everything is okay. But i couldn't find the
problem. This is my class about this subject.
(a.proTocusWt get the all values which i entered to textbox.)
public float proTocusWt;
public DataTable datasearch()
{
SqlConnection connect = new SqlConnection(conString);
connect.Open();
SqlCommand command = new SqlCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "fromProduct";
command.Connection = connect;
SqlParameter prm1 = new SqlParameter("@wt",SqlDbType.Float);
prm1.Value = proTocusWt;
command.Parameters.Add(prm1);
SqlDataAdapter adap = new SqlDataAdapter(command);
DataTable table = new DataTable();
adap.Fill(table);
return table;
}
And this is my Default.aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
AddCustomer a = new AddCustomer(); //This is for creating a object...
a.proTocusWt = Convert.ToSingle(TextBox1.Text);
GridView1.DataSource = a.datasearch();
GridView1.DataBind();
}
I think its happens because of the class. but i couldn't find it.