473,407 Members | 2,359 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,407 software developers and data experts.

how to update a specific cell of a table ?

hello all , i want to modify(update)a cell table. i have a website like a poll , and i want to modify dhe numbers of vote every time someone vote that item .. pls give me an idea or some code !!

Expand|Select|Wrap|Line Numbers
  1.  SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString1"].ConnectionString);
  2.         con.Open();
  3.         string Vote = "SELECT Project FROM projecttble WHERE Project = ('"+ RadioButtonList1.SelectedValue +"')";
  4.        SqlCommand cmd1 = new SqlCommand( Vote ,con );
  5.         string cmd3 = cmd1.ExecuteScalar().ToString();
  6.       Label1.Text = cmd3;
  7.  
  8.       string shtoVote1 = "SELECT Nr_votave FROM Tabela_projekteve WHERE Project = ('" + RadioButtonList1.SelectedValue + "')";
  9.       SqlCommand comand = new SqlCommand(shtoVote1, con);
  10.       string str1 = comand.ExecuteScalar().ToString();
  11.       int  str2 = int.Parse(str1) + 1;
  12.       Label2.Text = str2.ToString();
  13.  
  14.       string voto = "UPDATE Tabela_projekteve SET Nr_votave=@('"+str2+"'), Address=@NewAddress" +
  15.                     " WHERE Id=@Id ";
  16.  
  17.         con.Close();
  18.  
May 25 '13 #1
1 1281
Rabbit
12,516 Expert Mod 8TB
I don't see any reference to a table cell in your code. Do you mean a field in a row of a table in your database? It looks like you already have the code for that.
May 25 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Michael Schindler | last post by:
Hello NG How I can delete a specific cell in my Datagrid. I would like if the user is in the column 6 the value changed, after automaticly the value in the column 7 in the same row to delete....
2
by: tenzeel. | last post by:
i wants that the Event would fie when we click on DataGrid using Asp.net without using any select command or hyperlink. i just want that user click on the specific cell of datagrid then the even...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
1
by: Gidi | last post by:
Hi, Is it possible to Disable editing of one specific cell in one specific row in dataGrid? Thanks, Gidi.
1
by: mikename | last post by:
Hi, I'm currently working on a project which is essentially a clickable world map. I have successfully mapped the image and using a OnMouseOver = "Continent()" OnMouseOut = "World()" command in...
2
by: dismantle | last post by:
Hi everyone im new at vb and i already need help. Is it possible to get a specif cell in a column that i have created using sql database. For example: I made a table that have a 3 columns...
1
by: afromanam | last post by:
Hello, Good morning, I have a question, hope someone can help me. I have a table with say, 5 columns, each named A,B,C,D,E The table was imported from Excel, so picture please this:
1
by: tbakas2 | last post by:
Thank you in advance for the help. I'm using Microsoft XP, I'm in the VBA editor in Excel. I'm trying to write code that will assign a positive or negative value based upon what the adjacent cell...
5
by: omar999 | last post by:
im able to select & display all table data from sql database on to a webpage. but when I use the response.write method is it possible to output a specific cell with a WHERE or LIKE condition? ...
1
by: shalskedar | last post by:
I need to copy data from 1 workbook & paste to another workbook which i could do.. but i m not able to paste the data starting from the specific cell... Below is my code Dim wbk As Workbook...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.