.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

question about multi rows update in SQL table

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

Hello, im tryin to do something without success. I have some SQL table with few columns (fileId(int), fileName, copies, color and finish), the page is build in a way, that the user upload few files (the files uploads to some folder, and the fileId and fileName are write to the above SQL table - so the other columns (copies, color, finish) are stay blank - which is OK!!!) after he finished uploading the files he can see the files names in GridView and in that grid view i put some textbox for copies, and 2 DDL for color and comments. I need to update the rows with the new data after the user click some button (the all rows) this is the code:


<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                                        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="fileId"
                                        Width="100%" Font-Names="Arial" Font-Size="X-Small">
                                        <RowStyle ForeColor="#000066" />
                                            <asp:BoundField DataField="fileName" HeaderText

View Complete Post

More Related Resource Links

How to dynamically add table rows within update panel ?

Hi, In my webform, i have 3-4 textbox, on there textchange event i have to fetch data from database and put it on the form. I have taken another html table (with runat="server")  below textbox and  and in textchange event created a new <tr>, <td> and simply added contents in <td>, then finally added <tr> in the table. This is done in UpdatePanel. When i enter something in textbox1 data is added in that table,that's fine. But when i enter something in 2nd textbox the previous data is overridden. My requirement is that if 2nd textbox's text changes than another row with appropiate data should be added, i.e., now two rows. Silimarly if 3rd ,4th textbox data changes then subsequently 3 or 4 rows should be displayed. What should i do ?

SSAS_Cube Question..(How to update the Shipdate in Fact table..)

HI Friends,
I have a question regarding SSAS.
My question is...
Our business system has orders taking online and the order table has Order_Completedate, Which tells when the Order is completed.
We also have a Shipment table which tells which order is shipped on which date.
so while calculating my Fact table i am taking like

select .........
from Dim_Order o
left outer join Dim_Ordershipment ors on o.orderid=ors.orderid.

So my issue is 
My cube will be processed daily at 6 Am.
So if any order is completed and shipped before next day 6 Am then my Fact table has a Shipmentkey which is a Primary key of Dim_Ordershipment.
but if any order is completed today and shipped tomorrow after 6AM then my Fact table has every attribute but the Shipmentkey is loaded as Null.
I Load my Fact table on basis of checking weather a particular order is present or not.
like if it is present then don't load the record with that orderid else load it...

And one More reason why i am taking Left outer join instead of join at the Dim_Ordershipment is that my finance team checks daily in my

how many rows max. in a ms sql table [Could be a idiotic question. I know :)]



max how many rows can I store inside a table? or is it limitless. I am about to create a table which will have millions of rows. thanks for answering this question in advance :)

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

RadioButton Groups, Table Rows And NamingContainers in asp.net

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

RadioButton Groups, Table Rows And NamingContainers

(In which AJAX-enhanced CheckBoxes become more useful than RadioButtons but inheritance saves the day, and a simple RadioButton-derived control establishes the purpose of a control's naming container)

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

>>>How to update multiple rows of gidview by one click



I want to add multiple rows of a gridview if the data for multiple fields are same.

Idea for this is that a user may search a record with some parameter e.g. Sector, plot.

For example 15 records being displayed in gridview.

There should be checkbox before every row and if user wants to update Plot and Flat No that is same for 10 rows out of 15 so he will check the rows and update.

For this a dialog box should appear asking for the parameter i.e. Plot and Flat or something else next time may be it will be City or country. Moreover, there is already an Edit button to update records, when user click it another page open for the record to be updated and whatever he wants to update, it updates.

Hope everone understand the scenario.

I don't want to disturb the already provided Edit functionality and want to provide same record to be updated.

Any idea in this regard would be appreciated.

Cutting Edge: Creating a Multi-table DataGrid in ASP.NET


If you bind a multi-table DataSet to a DataGrid, only the first table is recognized. Here Dino Esposito writes a custom solution the the multi-table problem.

Dino Esposito

MSDN Magazine August 2003

execute update timedout expires , table with trigger due to recovery of database


I have table A in database A  , in table A i have trigger to insert record to database B table A, each update and insert of database A -table A, triiger fire and insert record in database B table A, when i try to update some times asp.net application gives error

"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

and then error log says System.Data.SqlClient.SqlException: Database 'database B is being recovered. Waiting until recovery is finished.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

Can't perform Create, Update or Delete operations on 'Table(outbox)' because it has no primary ke



I'm a beginner in asp.net and I have some problem inserting data into sql server 2005 with linq.


my code is : 


        Dim Result As New SMS.SendResult
        If Result.status = 0 Then
            Label1.Text = "Your Message Sent Successfuly"
            Dim db As New IGSSDataContext
            Dim out As New outbox With {.ClientID = intRandomNumber, .From = User.Identity.Name, .TO = TextBox1.TabIndex, _
            .Time = Now, .Message = Message}
            out.ID = (ID)
            TextBox1.Text = ""

update data on table

i have  100000 record  found in the  tha table and  i want  to update the column SocialState when found male he replace  the text male to 1 and when foun Female  he replace the text to 2   update [Drugs].[db_accessadmin].[Data] set SocialState='1' where SocialState='Male' update [Drugs].[db_accessadmin].[Data] set SocialState='2' where SocialState='FeMale' he give me this message "(0 row(s) affected)"

no of rows in single table

hi friends...i need one count...one sql table how many rows able to create or write in sql server 2005

How to get the Top N rows from SQL Table..

Hello Friends..                 Recently i have come across one question in sql queryQuestion:         Which SQL Query helps to view the TOP N rows From the particular SQL table?I request anyone please solve this question... Thanks...                   

wrapping a table into a multi column page

I have a table populated with some data fields that spans 5 pages.  I am trying to set up the layout to be a multi column report (just two columns) in which the table wraps at the end to populate the right section of the page How can this be done?Javier Guillen

Mark columns as Identity in multi-table views?

Hello! When you create a view of one table (i.e. SELECT * FROM Table), it marks the table's identity column as an identity col in the view as well. I have a few that selects columns from several nested tables, but they are all related in a main identity column I select as well, but SQL Server doesn't mark this column as identity, is there a way to do it?Shimmy

update sql 2008 with rows in sql 2000

Hi All, Currently I have data being inserted / updated on sql 2000. I want to update sql 2008 up to the minute. So I need to check and update sql 2008 with insert / update or delete occurred in sql 2000. My question is how to do it? I do not have timestamp column in any table. So do I need to add timestamp datatype column? If I do, then how do I keep track of starting and end value? Thanks in advance.  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend