473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Insert/Update Statement Examples?

Hi,

I am moving from classic ASP to ASP.NET 2.0. I have gone through the
quick start info. One of my top questions is on insert/update/delete
statements. I am unable to find examples/walk-throughs on how to do
this in 2.0 (without using the server controls like gridview). Can
anyone point out walk throughs or examples of how to do this?

Thanks,
William D.
http://www.ultraweaver.com

Feb 7 '06 #1
4 1102
Just open connection and use SQLCommand object.

SqlConnection con = new SqlConnection(clsGlobal.sConnection );

SqlCommand com = new SqlCommand();

com.CommandText = "DELETE FROM tblSectionInPage WHERE PageId=" +
_iPageId.ToString();

com.CommandType = CommandType.Text;

con.Open();

try

{

com.ExecuteNonQuery();

}

finally

{

con.Close();

}

George
"Joey D" <jo**@ultraweaver.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi,

I am moving from classic ASP to ASP.NET 2.0. I have gone through the
quick start info. One of my top questions is on insert/update/delete
statements. I am unable to find examples/walk-throughs on how to do
this in 2.0 (without using the server controls like gridview). Can
anyone point out walk throughs or examples of how to do this?

Thanks,
William D.
http://www.ultraweaver.com

Feb 7 '06 #2
Thanks for the example. I will look up SQL Command for further info.

Thanks again for the reply/example! Exactly what I needed.

Feb 7 '06 #3
Oh... last question.. I take it that from the Freamwork 1.1 to 2.0, SQL
command is basically the same?

Feb 7 '06 #4
Can not tell you about 2.0 because did not work with it.
but even if that is not the same I would think it should be similar.

George.

"Joey D" <jo**@ultraweaver.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Oh... last question.. I take it that from the Freamwork 1.1 to 2.0, SQL
command is basically the same?

Feb 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE,...
6
by: Karen Middleton | last post by:
In MS Access I can do in one SQL statement a update if exists else a insert. Assuming my source staging table is called - SOURCE and my target table is called - DEST and both of them have the...
1
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
3
by: Mukesh | last post by:
sir, i am developing a database, which will store the users profile both personal and professional which includes the address, telephone, gender and etc. in my main table i have created a column...
6
by: sgulciny | last post by:
hi friends; I have problem about sql server insert and update in client side. I am coding windows application with c#.When I run my code in database server computer all is fine.I can see data,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.