.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

auto increment column in SQL View

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


Can you please show me what is the syntax to add an increment column to Select Query? There will be additional column which goes 1,2,3 ... n. 

View Complete Post

More Related Resource Links

SharePoint Batch Update Auto Increment Field Value


Hello All,

I am making use of SharePoint List Batch Updating methodology in order to update the items in bulk. I build the query dynamically for each and every item using StringBuilder and process the data ultimately using 'ProcessBatchData' Method.

Now, I have a requirement where I have to increment a particular field value in the query while iterating through each item for building the query. How can I auto-increment a field value for each item in the batch query?


Datasheet view lookup column issue


When a column that has a lookup is empty in datasheet view and I attempt to update a different column I get this message: the text entered for isn't an item from the list. select an item from the list, or enter text that matches one of the listed items.

I found this hotfix, but it did not apply.


Any ideas how to get this resolved?

Replication and auto Identity Increment

We want to have two SQL server working on the same data at the same time (SQL Server 2008). I've been told that the auto ID's will stop working (the identity option). I'm not sure how true this is or what is the best replication to use for this.   Thanks

Auto Increment User defined Id

Hi can anyone give me an idea how to create an auto generated id like ED01,ED02 etc., so that when i am entering data the id should be automatically incremented

Hide grid view column if empty

 Hello All, I want to hide a grid view column if that column is empty. How do I do this? I dont have much exp. with grids. Please help me. Thanks in advance.

Sharepoint Calendar export to Outlook but can only view the Title column

I have created a Calendar in Sharepoint for booking out company vehicles. The fields I have created are: Vehicle (Choice), Driver (User/Group), Start & End Times, Title (text), DisplayField (Calculated text based on Vehicle + Title...... it would be nice to include Driver but it seems Sharepoint cannot handle the User/Group datatype in a calculated field.....but I digress). I use the DisplayField calculated field in my default calendar view in Sharepoint. All is good at this point. When one connects it to Outlook (via the Action menu in Sharepoint) the calendar is added but all the entries show only the Title field. If I double click on an entry, only the title field appears - the Vehicle and Driver values are missing. When I try to create a new entry - only the Title field (plus other default Outlook fields) are available. So: How can one display a value other than Title by default, and how can I display the other columns when looking at the event detail?

Problem when using calculated column as column group in a view

Hi,   I have a list with a calculated column named 'FullName', the formula is: "FirstName & " " &  LastName". I created a view group by 'FullName' column. The follow error appeared on the column:   <!-- #RENDER FAILED -->   Please help

How to pass page column value to data view parameters

Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

auto increment date

hi all, I have a table CLRYR with two columns STARTYR,  ENDYR I need to insert value into this these columns as below using a stored procedure STARTYR   ENDYR 1/1/2010 1/31/2010 1/1/2011 1/31/2011 1/1/2012 1/31/2012 i should be able to give the start yr and lets say i have to insert 50 yrs from now. So the values in these columns should add up upto 01/01/2060  01/31/2060 so i will have 50 records with the startyr and endyr. Please help me. thank you.

Sharepoint Designer 2010 modified view breaks "hyperlinks" column and formats all hyperlinks to the

I have been trying to perform a simple task with sharepoint designer 2010 that keeps breaking one of my list colums (in the custom view that is).  Background:  I have a list that we are using to assist with Document control in our organization.  The list consists of a few columns: Document number, Title, Owner, Doc Type, and file link (hyperlink to a pdf).  When I create a new out of the box standard view, everything works as desired.  However, I need to adjust the column widths on a couple columns in SharePoint designer, which seems to break the file link column functionality (all of the hyperlinks are now formatted to go to the same document, thought the file paths in each list item are correct).  Funtionality of the file links column works perfectly, until I make a single change to the view in SharePoint designer and save.  Any insight on this issue would be greatly appriciated.  

SQL auto increment in two tables

Hi, i have a problem with auto increment. I generated auto ID with auto increment, but after this i need to insert new ID to other table. Is possible to generate same ID to both tables? Is possible to do it without select command?

How to link Title to it's associated page in list view without URL path column visible -bug?

I don't know if this is a bug or if I'm an idiot (or perhaps both, I'm open minded).   My site I'm developing is a site with publishing features activated where all my news stories are pages. What I want to have is a sortable list (the type hypothetically achieved using the XsltListView Web Part) the lists these pages with 3 columns visible: The Date created, the title (not the page name), and the author. The tricky part is that I would like the title, when clicked on, to take the person to the page. I'm actually almost there. I've created a new view with these specifications except for one issue. To make the title linked to the page, I have to have the column "URL Path" in my list view. When I remove this column, the titles instead all link to the root of the directory I'm in (ex: if I'm in Pages/Forms/My_List.aspx it will link to Pages/Forms/) Is this a bug, or is the URL Path required for the link to work? Is there a way to hide the column? Thanks.

a simple way to auto-increment INT by 1 ?

Hi,   I have a field of datatype INT declared as follows  [barCodeID] int IDENTITY(1, 1) NOT NULL Each time I insert a new record into the table, barCodeID increments by 2, not by 1. Why so and can I make it increment by 1? I also tried [barCodeID] int IDENTITY(0 , 1) NOT NULL which produces exactly the same result, so what the first digit(seed) actually defines ? Thanks -- as you can see I'm a complete newbie

Applying conditional formatting to the 'AssignedTo' column does not work in a data view using Shar

This one is throwing me for a loop.  I've joined two lists using "Linked Sources" in SharePoint Designer.  On a new ASPX page I added a data view and added 3 columns (Title, Priority and AssignedTo) as a multi-Item view.   I can select a row and apply conditional formatting to the Title field (changing the background color if @title = 'Parent 1') and the changes are displayed in the design pane.   The only oddity there is that I have to go back and edit the condition in advanced mode, changing the XPath expression from ../../../Rows/Row/@Title = 'Parent 1' to @Title = 'Parent 1'  and then it seems to work just fine. Here's the problem.  I want the condition applied to the AssignedTo column (hide row if 'AssignedTo != 'John Doe')  If I create a condition to hide contents if the AssignedTo = 'John Doe' it creates the XPath expression ../../../Rows/Row/@AssignedTo = 'John Doe'.  When I save it, the row is still visible.  If I edit the XPath expression, changing it to @AssignedTo = 'John Doe' and save it the row is still visible.  The same is true if I simply try to change the background color, conditionally formatted  against the AssignedTo column. Does anyone have any ideas here?              

Column names in each view or function must be unique. Any Suggestions Please!!!!!!!!

I am getting this error when I am executing this view. But I am not getting this Error when parsing the query!!! Can some one help me with the issue. Create   view [PosSales_Transactions_Tenders_Extract] AS SELECT RT .RTL_TRN_ID, RT .STORE_NO, RT .WORKSTATION_NO, RT .RTL_TRN_NO, RT .RTL_TRN_TYPE_CODE, RT .AMOUNT, RT .OPERATOR_NO, RT .CUSTOMER_NO, RT .EMPLOYEE_NO, RT .BUSINESS_DATE, RT .BEGIN_DATETIME, RT .END_DATETIME, TLI .LINE_ITEM_NO, TLI .TENDER_TYPE_ID, TLI .TENDER_TYPE_CODE, TLI .TENDER_AMOUNT, TLI .CHANGE_FLG, TLI .SERIAL_NO, TLI .KEYED_FLG, TLI .EXCHANGE_RATE, TLI .FOREIGN_TENDER_AMT, TE .TENDER_TYPE_ID, TE .TENDER_TYPE_DESC FROM   dbo.RETAIL_TRANSACTION RT JOIN   dbo.TENDER_LINE_ITEM TLI ON   RT.RTL_TRN_ID = TLI.RTL_TRN_ID JOIN   dbo.TENDER TE ON   TLI.TENDER_TYPE_ID = TE.TENDER_TYPE_ID WHERE   RT.VOID_FLG = 0 AND RT .VOIDED_FLG = 0 AND RT .VOIDING_FLG = 0 AND RT .SUSPENDED_FLG = 0 AND RT .TRAINING_FLG = 0 Msg 4506, Level 16, State 1, Procedure PosSales_Transactions_Tenders_Extract, Line 4 Column names in each view or function must be unique. Column name 'TENDER_TYPE_ID' in view or function 'PosSales_Transactions_Tenders_Extract' is specified more than once.

Auto-fill Title and other fields from a data View edit menu

How do I Auto-fill Title and other fields in a list from a data View edit menu. The Title and other current data should transfer from the data view row being edit. Can anyone point me into the right direction how to accomplish this? Thanks. Mike  

How do I remove column headers in list view webpart?

I'd like to remove the column headers from a list view web part, as well as from a document library web part. How can I accomplish this in SharePoint 2010?
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