Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Update db when Event is Triggered

Posted on 2006-10-22
1
Medium Priority
?
192 Views
Last Modified: 2010-04-16
I would like to use a button to update a bool field in a dB, using a SqlDataSourse.
The default value in the dB is ‘0’ I would like the button click event to change it to ‘1’.
The SqlDataSourse is set to ‘Select *’ for the table name.

Could someone show me how to do this, in C#?

In other words, i would like the dB to be updated when a event is triggered.

Thanks for any help in advance.  
0
Comment
Question by:bmanmike39
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 1500 total points
ID: 17788034
System.Data.SqlClient.SqlConnection ACo  =
                        new System.Data.SqlClient.SqlConnection(UrConnectionString);
                  ACo.Open();
                  string Query = "Update table set somethig = 'test' where anothersomething = 'avalue'";
                  System.Data.SqlClient.SqlCommand ACommand =

                        new System.Data.SqlClient.SqlCommand(Query,ACo);
                  ACommand.ExecuteNonQuery();
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question