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

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

Update Statment question

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :Sql Server
I came across a problem to update a varchar(MAX) field. I use a varchar(MAX) field to save transaction data. It is required to update that field once a while by removing sensetive infromation from that field. I use update statment to do that and everything looks fine. But, if I back up the database and open it using notepad I can see those sensetive strings. It looks to me that update statement allocates another space to save the new data and does not zero fillout the space used by old data. It is kind of like deleting files from OS. What can I do in this case?   Thanks, David    

View Complete Post

More Related Resource Links

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

question about multi rows update in SQL table


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

update panel woes... question for superstar AJAX gurus



This has got me completely confused... not sure if I've been at it too long and am missing something, or if this is a bug?

I have a webform with an AJAX update panel. In the panel there are 2 controls. One is a textbox, the other a listview.

I'm using the ClientScriptManager to take advantage of the "OnKeyUp" event to cause an autopostback.

When text is entered into the textbox, it runs the textchanged event, which puts data in the listview.

So far so good. All works fine with one exception.

Problem is that with IE8 the textbox loses focus on the SECOND text entry, even though it's specified in my code to focus on textbox after the textchanged event fires. And with Firefox, it doesn't cause the textchanged event to fire at all.

I don't get it??

Here's my code...

    Sub Page_load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load


        TextBox1.Attributes.Add("onKeyUp", Page.ClientScript.GetPostBackEventReference(TextBox1, ""))

    End Sub

    Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox1.TextChanged

        Listbox1.Items.Add(New ListItem("ListboxItem", "ListboxValue"))

        TextBox1.Text = ""


Update Panel - Speed: Question on how to increase speed



Does the use of update panels increase the speed of a website?

A code sample:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
<asp:Panel ID="Panel1" runat="server" HorizontalAlign="Left" Wrap="False" ScrollBars="Vertical" style="position: relative">
<asp:Label ID="LabelClock" runat="server" Text="Label"></asp:Label>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>



<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">

<asp:Panel ID="Panel2" runat="server">
<asp:Label ID="LabelNumber" runat="server" Text="Label"></asp:Label>



LabelClock.Text is set at every postback in the page load event, to the current time. But the UpdatePanel1 is only updated when the con

Update statment syntax


update dbo.Spectrum_ScoreCard_NEW
set branch = dbo.tblUser.fldUserBranch
dbo.Spectrum_ScoreCard_NEW.Name = dbo.tblUser.fldUserFName + ' ' + dbo.tblUser.fldUserLName


I want to update all the branches in spectrum scorecard with the branches in userbranch where they names are the same.

what is wrong with this syntax?

ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

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.

Update Vs SystemUpdate

Many of you might noticed that share point ListItem has Update() method as well as SystemUpdate().

What is the difference between these two methods and why MOSS has two different APIs for updating an ListItem

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

>>>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.

Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



Web Site to Web Application Question


I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?



connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

Security Question Answer Retrieval


I know there is a method built in for retrieving the encrypted password, but how do I retrieve the encrypted security answer?

What I want to do is have a member profile update screen that the end user can update their password and security question and answer. However, when they get to this page, I want to already be showing the security question (the easy part) and its answer (the not so easy part).

I have updated web.config with passwordFormat=Encrypted and have added a machineKey with the generator (forgot the link, but located on eggheadcafe somewhere).

I haven't done ANYTHING yet, since I already have a user store with hashed information. I wanted to get some functionality done before publishing, wiping the store and recreating users (only a couple developers).


Update net frame 3.5.


I use visual studio 2008 but It's only use net frame work 2.0, Can I update and use net frame work 3.5 for Visual Studio 2008 ? Please help me !


Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




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