Q: Bind data to several TextBoxes?

  • Thread starter Visual Systems AB \(Martin Arvidsson\)
  • Start date
V

Visual Systems AB \(Martin Arvidsson\)

Hi!

I have a webform with several TextBoxes. How can i bind the data to all the
fields without having to issue TextBox1.DataBind(); textBox2.databind() and
so on?

Also, when assigning data from the fields to the query or stored procedure
i today use DataAdapter.UpdateQuery.Parameters["@CustomerID"].Value =
TextBox1.Text;
and so on with all the forms, is it possible to somehow, assign the data on
the form to all
the paratmeters with one command?

I have done a databinding, and assigned the collection to the fields so they
all have
a corresponding field in the DataSet...

Regards

Martin Arvidsson
 
M

Miha Markic [MVP C#]

Hi,

Visual Systems AB (Martin Arvidsson) said:
Hi!

I have a webform with several TextBoxes. How can i bind the data to all
the
fields without having to issue TextBox1.DataBind(); textBox2.databind()
and
so on?

I think that Page has DataBind method that should do it for all controls on
it.
Also, when assigning data from the fields to the query or stored procedure
i today use DataAdapter.UpdateQuery.Parameters["@CustomerID"].Value =
TextBox1.Text;
and so on with all the forms, is it possible to somehow, assign the data
on
the form to all
the paratmeters with one command?

Only if you define appropriate method.
 
V

Visual Systems AB \(Martin Arvidsson\)

Hi!

Miha said:
Also, when assigning data from the fields to the query or stored procedure
i today use DataAdapter.UpdateQuery.Parameters["@CustomerID"].Value =
TextBox1.Text;
and so on with all the forms, is it possible to somehow, assign the data
on
the form to all
the paratmeters with one command?

Only if you define appropriate method.

Anyone know, what he meant with "Only if you define appropriate method". I
am a
bit new to this with Visual Studio and .NET web development :D

regards

martin


Miha Markic said:
Hi,

message news:[email protected]...
Hi!

I have a webform with several TextBoxes. How can i bind the data to all
the
fields without having to issue TextBox1.DataBind(); textBox2.databind()
and
so on?

I think that Page has DataBind method that should do it for all controls on
it.


Also, when assigning data from the fields to the query or stored procedure
i today use DataAdapter.UpdateQuery.Parameters["@CustomerID"].Value =
TextBox1.Text;
and so on with all the forms, is it possible to somehow, assign the data
on
the form to all
the paratmeters with one command?

Only if you define appropriate method.
 
M

Miha Markic [MVP C#]

Hi,
Also, when assigning data from the fields to the query or stored procedure
i today use DataAdapter.UpdateQuery.Parameters["@CustomerID"].Value =
TextBox1.Text;
and so on with all the forms, is it possible to somehow, assign the
data
on
the form to all
the paratmeters with one command?

Only if you define appropriate method.

Anyone know, what he meant with "Only if you define appropriate method". I
am a
bit new to this with Visual Studio and .NET web development :D

I did mean that there is no such built-in method and you have to code one
yourself :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top