DOTNet Web apps &adding new record to sql 
Author Message
 DOTNet Web apps &adding new record to sql

I need halp with a web app adding a new record to an sql database i can view
the data and edit the data but how do i do an add new


Mon, 27 Dec 2004 01:43:16 GMT  
 DOTNet Web apps &adding new record to sql
You can refer to the following article, titled "Top Questions about the
DataGrid Web Server Control", section "Adding New Records to a Data Source
Using the DataGrid Control",  on MSDN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...
t/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp

Thanks
Robin, Seth & Mohan
VB Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> I need halp with a web app adding a new record to an sql database i can
view
> the data and edit the data but how do i do an add new



Mon, 27 Dec 2004 04:35:44 GMT  
 DOTNet Web apps &adding new record to sql
Adding new records is relatively easy if you already know how to read and
update records.  You need to create a new row in your dataset, and assign
values to the fields in the row.  Then, you need to update the dataset.  The
following code assumes you have a web application with a dataset named
DataSetRound, and the Dataset contains a table named Hand.  The method
AddHandRow is generated

Dim dsNewDataSet As New DataSetRound()

Dim rowNewRow As DataSetRound.HandRow

' Create new record row for the data table

rowNewRow = dsNewDataSet.Hand.AddHandRow(intNewHandID, intRoundID, strCards)

' Updates the data via the data adapter. This saves the data to the database

SqlDataAdapterHand.Update(dsNewDataSet.Hand)

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> I need halp with a web app adding a new record to an sql database i can
view
> the data and edit the data but how do i do an add new



Mon, 27 Dec 2004 04:35:14 GMT  
 DOTNet Web apps &adding new record to sql
This looks good but i am having troble with "(intNewHandID, intRoundID,
strCards)" This part what does it do my dataset is dscategories and table
mane is Categories And Thank you for your help so far!!!



Quote:
> Adding new records is relatively easy if you already know how to read and
> update records.  You need to create a new row in your dataset, and assign
> values to the fields in the row.  Then, you need to update the dataset.
The
> following code assumes you have a web application with a dataset named
> DataSetRound, and the Dataset contains a table named Hand.  The method
> AddHandRow is generated

> Dim dsNewDataSet As New DataSetRound()

> Dim rowNewRow As DataSetRound.HandRow

> ' Create new record row for the data table

> rowNewRow = dsNewDataSet.Hand.AddHandRow(intNewHandID, intRoundID,
strCards)

> ' Updates the data via the data adapter. This saves the data to the
database

> SqlDataAdapterHand.Update(dsNewDataSet.Hand)

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.



> > I need halp with a web app adding a new record to an sql database i can
> view
> > the data and edit the data but how do i do an add new



Tue, 28 Dec 2004 00:15:29 GMT  
 DOTNet Web apps &adding new record to sql
The sample code I gave you will only work for a specific table.  You must
modify the code to work with your specific table and field names.  If you
have added a data connection, and a data adapter to your project, you should
have a menu command under the Data menu that says "Generate Dataset". A file
with a name like "DataSet1.XSD" is your data set.  The following code adds a
new row to a table named "author".  The variables "authorID" and
"authorLastName" are variables that contain the data you want to add to the
new row.

Dim dsNewDataSet As New DataSet1()

Dim rowNewRow As DataSet1.authorsRow

rowNewRow = dsNewDataSet.authors.AddauthorsRow(authorID, authorLastName)

SqlDataAdapter1.Update(dsNewDataSet.authors)

You can refer to the following article, titled "Top Questions about the
DataGrid Web Server Control", section "Adding New Records to a Data Source
Using the DataGrid Control",  on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...
t/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp

Dan Morseburg (VB)

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> This looks good but i am having troble with "(intNewHandID, intRoundID,
> strCards)" This part what does it do my dataset is dscategories and table
> mane is Categories And Thank you for your help so far!!!



> > Adding new records is relatively easy if you already know how to read
and
> > update records.  You need to create a new row in your dataset, and
assign
> > values to the fields in the row.  Then, you need to update the dataset.
> The
> > following code assumes you have a web application with a dataset named
> > DataSetRound, and the Dataset contains a table named Hand.  The method
> > AddHandRow is generated

> > Dim dsNewDataSet As New DataSetRound()

> > Dim rowNewRow As DataSetRound.HandRow

> > ' Create new record row for the data table

> > rowNewRow = dsNewDataSet.Hand.AddHandRow(intNewHandID, intRoundID,
> strCards)

> > ' Updates the data via the data adapter. This saves the data to the
> database

> > SqlDataAdapterHand.Update(dsNewDataSet.Hand)

> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.



> > > I need halp with a web app adding a new record to an sql database i
can
> > view
> > > the data and edit the data but how do i do an add new



Tue, 28 Dec 2004 04:17:40 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. adding new records & new record

2. Problem adding new record to SQL database recordset

3. Remote Data Control--Problems with Adding new Record to SQL Server 6.0 Database

4. Problem adding new record using SQL Server

5. Unable to add new record in sql table

6. ADO and SQL Server error adding new record

7. Problem with ADO and SQl Server on adding a new record in a table

8. deleting records in a table and then adding new records

9. How to add new records in a new database

10. ADO2.5, can't add new record to an empty table using record binding

11. Add new record with coding.

12. How to add new record to table in external location

 

 
Powered by phpBB® Forum Software