Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Inserting Records


Message #1 by "Renee Walker" <rwalker@w...> on Wed, 12 Dec 2001 19:28:04
I'm trying to insert records via ado.net.  I've created a data adapter 

through the wizard.  In properties I see an insert property that has a SQL 

statement in there, but I want to insert the values in my controls on the 

web form.  I'm not sure if I need to bind my values, etc.  Please Help!!
Message #2 by "Fredrik Normén" <fnormen@h...> on Tue, 18 Dec 2001 14:37:01
Hi,



Will you add a new record to the database or do you want to display 

records from the data source?



If you want to display the records you can bind the record to a Html 

server control like a DataList.



Here is an example:



<script Language="C#" Runat="server">



myDataList.DataSource = myRecord;

myDataList.DataBind();





</script>



<asp:datalist id="myDataList" runat="server">

<ItemTemplate>

   <%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

</ItemTemplate>

</asp:datalist>





This code will get value from the "myItemToBind" column of the record you 

have specified as a DataSrouce to the control.



<%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>



I hope this is what you are looking asking for.



/Fredrik Normén





> I'm trying to insert records via ado.net.  I've created a data adapter 

> through the wizard.  In properties I see an insert property that has a 

SQL 

> statement in there, but I want to insert the values in my controls on 

the 

> web form.  I'm not sure if I need to bind my values, etc.  Please 

Help!!
Message #3 by "Walker, Renee C." <rwalker@w...> on Tue, 18 Dec 2001 08:36:56 -0600
I'm just adding new records to the database.  I don't need to display 

any

data.



Thanks.



-----Original Message-----

From: Fredrik Norm=E9n [mailto:fnormen@h...]

Sent: Tuesday, December 18, 2001 8:37 AM

To: ADO.NET

Subject: [ado_dotnet] Re: Inserting Records





Hi,



Will you add a new record to the database or do you want to display

records from the data source?



If you want to display the records you can bind the record to a Html

server control like a DataList.



Here is an example:



<script Language=3D"C#" Runat=3D"server">



myDataList.DataSource =3D myRecord;

myDataList.DataBind();





</script>



<asp:datalist id=3D"myDataList" runat=3D"server">

<ItemTemplate>

   <%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

</ItemTemplate>

</asp:datalist>





This code will get value from the "myItemToBind" column of the record 

you

have specified as a DataSrouce to the control.



<%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>



I hope this is what you are looking asking for.



/Fredrik Norm=E9n





> I'm trying to insert records via ado.net.  I've created a data 

adapter

> through the wizard.  In properties I see an insert property that has 

a

SQL

> statement in there, but I want to insert the values in my controls on 



the

> web form.  I'm not sure if I need to bind my values, etc.  Please

Help!!




$subst('Email.Unsub').

Message #4 by "Fredrik Normen" <fnormen@h...> on Tue, 18 Dec 2001 15:51:08 +0100
Ah, ok



Here is an article I think you would like.

It about Data Operations on Sets of Rows. If you scroll down a bit in the 

article you will find the topic "Insert". I think you will find  what you 

are asking for.



http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdadotnetdata3.asp



/Fredrik Normén







>From: "Walker, Renee C." <rwalker@w...>

>Reply-To: "ADO.NET" <ado_dotnet@p...>

>To: "ADO.NET" <ado_dotnet@p...>

>Subject: [ado_dotnet] Re: Inserting Records

>Date: Tue, 18 Dec 2001 08:36:56 -0600

>

>I'm just adding new records to the database.  I don't need to display any

>data.

>

>Thanks.

>

>-----Original Message-----

>From: Fredrik Normén [mailto:fnormen@h...]

>Sent: Tuesday, December 18, 2001 8:37 AM

>To: ADO.NET

>Subject: [ado_dotnet] Re: Inserting Records

>

>

>Hi,

>

>Will you add a new record to the database or do you want to display

>records from the data source?

>

>If you want to display the records you can bind the record to a Html

>server control like a DataList.

>

>Here is an example:

>

><script Language="C#" Runat="server">

>

>myDataList.DataSource = myRecord;

>myDataList.DataBind();

>

>

></script>

>

><asp:datalist id="myDataList" runat="server">

><ItemTemplate>

>    <%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

></ItemTemplate>

></asp:datalist>

>

>

>This code will get value from the "myItemToBind" column of the record you

>have specified as a DataSrouce to the control.

>

><%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

>

>I hope this is what you are looking asking for.

>

>/Fredrik Normén

>

>

> > I'm trying to insert records via ado.net.  I've created a data adapter

> > through the wizard.  In properties I see an insert property that has a

>SQL

> > statement in there, but I want to insert the values in my controls on

>the

> > web form.  I'm not sure if I need to bind my values, etc.  Please

>Help!!




>












_________________________________________________________________

MSN Photos is the easiest way to share and print your photos: 

http://photos.msn.com/support/worldwide.aspx



Message #5 by "Walker, Renee C." <rwalker@w...> on Tue, 18 Dec 2001 08:55:22 -0600
Yes, this is what I'm looking for. 



Thank you.  Happy Holidays.



-----Original Message-----

From: Fredrik Normen [mailto:fnormen@h...]

Sent: Tuesday, December 18, 2001 8:51 AM

To: ADO.NET

Subject: [ado_dotnet] Re: Inserting Records





Ah, ok



Here is an article I think you would like.

It about Data Operations on Sets of Rows. If you scroll down a bit in 

the

article you will find the topic "Insert". I think you will find  what 

you

are asking for.



http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/dnbda

/html/

bdadotnetdata3.asp



/Fredrik Norm=E9n







>From: "Walker, Renee C." <rwalker@w...>

>Reply-To: "ADO.NET" <ado_dotnet@p...>

>To: "ADO.NET" <ado_dotnet@p...>

>Subject: [ado_dotnet] Re: Inserting Records

>Date: Tue, 18 Dec 2001 08:36:56 -0600

>

>I'm just adding new records to the database.  I don't need to display 

any

>data.

>

>Thanks.

>

>-----Original Message-----

>From: Fredrik Norm=E9n [mailto:fnormen@h...]

>Sent: Tuesday, December 18, 2001 8:37 AM

>To: ADO.NET

>Subject: [ado_dotnet] Re: Inserting Records

>

>

>Hi,

>

>Will you add a new record to the database or do you want to display

>records from the data source?

>

>If you want to display the records you can bind the record to a Html

>server control like a DataList.

>

>Here is an example:

>

><script Language=3D"C#" Runat=3D"server">

>

>myDataList.DataSource =3D myRecord;

>myDataList.DataBind();

>

>

></script>

>

><asp:datalist id=3D"myDataList" runat=3D"server">

><ItemTemplate>

>    <%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

></ItemTemplate>

></asp:datalist>

>

>

>This code will get value from the "myItemToBind" column of the record 

you

>have specified as a DataSrouce to the control.

>

><%# DataBinder.Eval(Container.DataItem,"myItemToBind") %>

>

>I hope this is what you are looking asking for.

>

>/Fredrik Norm=E9n

>

>

> > I'm trying to insert records via ado.net.  I've created a data 

adapter

> > through the wizard.  In properties I see an insert property that 

has a

>SQL

> > statement in there, but I want to insert the values in my controls 

on

>the

> > web form.  I'm not sure if I need to bind my values, etc.  Please

>Help!!




$subst('Email.Unsub').

>




$subst('Email.Unsub').









_________________________________________________________________

MSN Photos is the easiest way to share and print your photos:

http://photos.msn.com/support/worldwide.aspx








$subst('Email.Unsub').


  Return to Index