.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

limiting updates to only 1 row?

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Sql Server


Hi all, i have a sql statement like this update tbl set col1=10 where col2=5 . is there a way to limit the update to only 1 row? (like say if there are multiple rows with col2 having a value of 5, only 1 of them would be updated)

View Complete Post

More Related Resource Links

Formview LinqData source not allowing updates


OK, I'm confused.  I've set up a formview with a Linqdata source to allow users to edit records.  When I run it, edit data and submit, it blows up and tells me "Linq datasource6  does not support the Select property when the Delete, Insert or Update operations are enabled."  I googled that warning and saw a couple of posts on this forum saying the problem is the slect statement has to be removed from the Linq data source for it to allow updates. 

But if I remove the select statement then how do I show the user specific info on pageload?   plus I thought the two way databind was an advantge of the datasource control.




SQL and Outlook: Enable Database Access and Updates Through Exchange and Any E-mail Client


Using Microsoft technologies, you can insert, edit, query, and delete database entries using any e-mail client such as Hotmail, Outlook, Yahoo, or even WAP phone. While e-mail is certainly a powerful and widely used tool, it is usually not integrated with an application for performing any tasks other than sending reminders. The application scenario described here, an e-mail-based SQL update program, uses a simple data model; however, this solution will apply to any data model that you are working with. It will also eliminate the need for complex n-tier Internet applications and serves as a low maintenance solution for providing data access.

Alok Mehta and Daniel Williams

MSDN Magazine January 2002

Display last inserted column value in the Form and concurrent updates


1) I have a ORDER form which is a usercontrol(webpart in sharepoint)

    the first field is a autogenerated column given as ORD01,ORD02,ORD03...

    for this i have a column in the list which stores these values into list after user submits data.

    Now i want to show last inserted ORDER + 1 in the first field .

    i.e., when user opens this ORDER page it should show the value.

2) the second case would when user submits data simultanoeusly.


Can anyone suggest a solution for this



Disregarding updates on non-checked-in entries in a sharepoint list (SPAudit)


Hey guys.

Okay, this is a little hard to explain, as the title might suggest.

I have an event receiver on ItemUpdated and ItemCheckedIn, which both writes custom SPAuditEntries. When CheckedIn occurs though - it comes with two update entries as well (one for added file, and one for a simple update to the list item I suspect).

I'd love to get rid of these entries. At first I thought it would be really simple, just put an if in the itemUpdated event receiver, and stop everything

if(SPListItem.CheckedOut = false) { //... do nothing }

However I couldn't find any way to ascertain the checkout-status of the listitem. My next thinking was, they hit almost at exactly the same time, so I could just crawl into the auditCollection, filter down to the specific listitem, user, and time (minus a second) and delete the two entries. But, sadly I found out I couldn't delete auditentries.

Anyone got any ideas?

Transactional replication: Updates to one of my columns (sometimes) does not get replicated from the

hi, This is my scenario: I have a varchar(max) column on a table that is replicated to other servers. I have a stored procedure that does and update to this column and other columns on the table. This is done inside a transaction that also includes other updates. When I call the stored procedure, this one varchar(max) column's value is not replicated. When I just run the single update statement on its own, the value is replicated. Anyone know something about this? Thanks!    

Custom List: Request updates quarterly

I have a custom list of clients. Each client has an owner (person or group column).   I need to be able to request an update each quarter from the person listed in the owner column. What is the best way to achieve this?

Limiting MySites and Email during closed POC.

SharePoint 2010, Small Farm Installation. Win2008R2, SQL2008R2  Howdy, I'm wrapping up a Proof of Concept and about to deploy it to users.  Management has asked that I limit the visiting of the Mysites to only the core POC folks.  About 40 or so people, likely a slowly expanding circle. Once the POC is completed, I envision it opening up to the entire company, and creating an extranet, and a second farm for clients.  This POC will enclude Enterprise Search, Productivity Hub, and numerous collaborative type sites.  What is the best way to effectively remove rights to all but the minimal group from accessing the Mysites.  If I pull the profiles from AD for the entire company does this somehow provide rights to this area? Also, is there a way to block emails from being sent to staff, with the exception of the POC group..  I hope I'm explaining this with enough detail.  Thanks,  

Limiting Nickname / Phonetic matching to just First Name

The Nickname / Phonetic matching in SharePoint 2010 is a nice new feature, where searching for Jeff will pull up results for Geoff, Jeffrey, etc. However, it also searches surnames and pulls in people with a last name like Jefferson, Jeffery, Jeffrey When creating your query, is there any way to limit the nickname searching to just the forename? If I do a queries like "FirstName:Jeff" or "FirstName=Jeff", then it stops doing nickname/phonetic matching. I've also tried "Nickname:Jeff" and "FirstNamePhonetic:Jeff", but these do not pull up any results at all. How does the nickname/phonetic matching work internally, does it search over a number of internal field names (if so, can these be searched using the advanced property search such as FirstName:Jeff). I thought perhaps I could get the kind of search we need by combining it with logical operators, so if I want any person with a first name sounding like Jeff, and surname beginning with B, then I could do this...   LastName:B* (FirstName:Jeff* OR Jeff) ...but the Jeff on it's own without a Property name Prefix causes a Malformed Query error, I assume it cannot be applied with Logical Operators. Changing the query to...   LastName:B* FirstName:Jeff* Jeff ...brings results, but the wrong results we want as the query does not pull back people with a Forename of Geoff, presumably

Reinstalling the same updates

My computer is asking me to install the following UPDATES everyday for the past two weeks OR MORE.  WHY??? Microsoft .NET Framework 3.5 SP1 Update for Windows Server 2003 and Windows XP x86 (KB982168) Security Update for .NET Framework 2.0 SP2 and 3.5 SP1 on Windows Server 2003 and Windows XP x86 (KB983583) Microsoft .NET Framework 3.5 SP1 and .NET Framework 2.0 SP2 Update for Windows Server 2003 and Windows XP x86 (KB982524) What can I do?

Creating and sharing new sharepoint site to internet, limiting user access

I am a new hire into an existing business as I.T. I know the networking, I know the computers. The owner now wants me to learn Sharepoint among some other things. They currently use WSS 3.0. I have been reading up on this for the last month. I think I am ready to extend the current site to make it an Internet site so the employees can login. Some other things we would like to do I have read up on and it looks like they can be done, things such as inventory tracking in collaboration with QuickBooks and creating a website / portal for clients to have a unique login on and can see the status of their jobs in custom SharePoint lists. As far as I can tell the clients need an AD account. However, apart from that I am not sure what to do. A little background.  The company has multiple clients, and we ship things out daily to those clients.  We use Sharepoint to track the status of the jobs as they progress through the stages ultimately going to delivery. There is one common page that lists all the jobs by all clients that is updated constantly. We would like to allow multiple (different) clients/logins and have a page customized for each client.  For example, you are a client and go to www.companyname.com/sharepointsite.html.  From there you would get to a portal page with a login. Once logged in you will be presented with the Shar

How to get a list of installed MOSS 2007 updates?

We have several problems with our MOSS 2007 installation and operation and since we found out that two identical sharepoint servers (production and test) that had same updates applied have different Search_DB databases (they have same name function with different number of parameters, for ex.) we have a single idea of what can be the cause: Somehow, windows update or other quirk, an update or hotfix got applied to one of the servers.  Strange thing is, noone of our employees seems to know, neither google seems to know, how do we exactly get a list of installed updates on the MOSS 2007 installation.   So, simple question: HOW? How do we get a complete list of changes (hotfixes, servicepacks, patches) done to an installation of MOSS?

Limiting records returned by AutoCompleteExtender

Hi all,   I am using AutoCompleteExtender on a text box as follows <cc1:AutoCompleteExtender ID="aacId" runat="server" DelimiterCharacters="" Enabled="True"                        CompletionListCssClass="autocompleteplus_listItem" CompletionListHighlightedItemCssClass="autocompleteplus_highlightedListItem"                        CompletionListItemCssClass="autocompleteplus_listItem" CompletionListElementID="autocompleteplus_completionListElement"                        ServiceMethod="GetCompletionListId" ServicePath=""                         TargetControlID="txtCandidateId" MinimumPrefixLength="2"                         CompletionSetCount="10"> My problem i

Why is it that this code updates my sql database with the default EditBox text?

Any help is appreciated. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using MySql.Data.MySqlClient; public partial class _Default : System.Web.UI.Page { TextBox EditBox = new TextBox(); TableRow[] NewRows = { new TableRow(), new TableRow() }; TableCell[] NewCells = { new TableCell(), new TableCell() }; string ID; protected void Page_Init(object sender, EventArgs e) { } protected void Page_Load(object sender, EventArgs e) { var Connection = new MySqlConnection("Server=localhost;Database=site;Username=root;Password=root"); var Command = new MySqlCommand("select * from news", Connection); Connection.Open(); var Reader = Command.ExecuteReader(); while (Reader.Read()) { ID = Reader.GetString("ID"); string Title = Reader.GetString("Title"); string Text = Reader.GetString("Text"); foreach (TableRow Row in NewRows) { NewsTable.Rows.Add(Row); } NewCells[0].Text = Title; NewCells[1].Text = Text; NewCells[0].Font.Bold = true; NewCells[0].Font.Underline = true; NewCells[0].Font.Size = Fon

Regasm updates from v1.1 to v2.0

Have there bee any significant updates for regasm from 1.1 to 2.0 that would cause COM to no longer be compilable by VB6.  The following now gives us a compile error when building VB6, "Expected function or variable". [ComVisible(true),Guid("5075DB0A-4B05-3351-8B1C-30ED2E1E174D")] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IMyInterface {   void CheckAuth(string ldapUrl, out string asUserId, out string asPassword,  out string message, out short sRetCd); } [ComVisible(true),Guid("99C9BFCB-A1DC-359D-8BE5-46849EF8E0D3")] [ProgId("MyAssembly.MyClass")] [ClassInterface(ClassInterfaceType.None)] public class MyClass : IMyInterface {   public void CheckAuth(string ldapUrl, out string asUserId, out string asPassword,    out string message, out short sRetCd)   {     // Do work   } } VB6: Dim comObj As MyAssembly.MyClass Dim stUserId As String Dim stPassword As String Dim stMessage As String Dim sRet As Integer Dim iResult As Integer Set comObj = New MyAssembly.MyClass iResult = comObj.CheckAuth(strURL, stUserId, stPassword, stMessage, sRet) Thanks, Mike...

Limiting Search Scopes to Articles, .docs, .xls, etc.

We have a customized site with a number of workarounds, which has necessitated using multiple pages to display data. EG, a contributor might use an "AnnouncementUPLOAD.aspx" page to add data displayed through a Web Part on "Announcement.aspx". I know I can Security Trim at the page and DocLib levels which would carry over into what's revealed by Search, but I'm curious if I can handle this through Scopes. So, if I ran a search for "George Washington", I'd want to return: items in DocLibs (ie Office Documents) items from Announcements, but NOT the full Announcement List. (ie not the http://.../pages/Announcement.aspx page, but the http://.../lists/Announcement.aspx page.) Doable? Thanks!

SQL changes from Mixed to Windows auth mode after SQL updates

We run a SQL 2005 cluster on Windows 2008 in Mixed authentication mode.  The last two times we have applied a SQL security patch, it automatically changed the auth mode from Mixed to Windows-only, taking our applications offline.  Most recently was today, when we applied KB970892. Can someone explain why this is happening and how we can prevent it?
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