DataSource Controls :: Concatenate Field For Unique Identifier?

Feb 3, 2010

I'm using Visual Web Developer Express 2008 and SQL Management Studio Express 2005. I need to link 2 tables to either present in a Master/Detail or GridView/Form view.The goal is to allow the user to view time card information from the AS400 (read only) and then enter any corrections into a SQL table. My problem is in trying to connect the two tables.I've asked the AS400 administrator to add a unique identifier field to the table (HAPOINT), but he says he can't. I've tried to concatenate a field within Visual Web Developer's Query Builder but keep getting errors.Table 1 - exists in AS400, is non-permanent (cleared every 3 months) and can't be modifiedEmpl ID WO Date In Time In Date Out Time Out Table 2 - exists in SQL Server, newly created for this project (no data yet, so can be modified)Rev ID Empl ID Date (of revision entry) X (Revise - y/n) Revised Time In Revised Time Out I tried finding a solution through the SQL Forum, but haven't gotten a solution, so I'm posting here. There are additional details at that post:http://forums.asp.net/p/1516929/3658517.aspx#3658517Can anyone tell me how to concatenate "Empl ID /WO / Date In / Time In" from Table 1 to produce a unique identifier that I can then use in Table 2, thus providing the link between the two tables? Or, is there another way?

View 8 Replies


Similar Messages:

DataSource Controls :: SQL Statement / Don't Have Any Unique Identifier?

Mar 11, 2010

I am just wondering how do I get the very last row of a join statement if I don't have any unique identifier... as in row_number field?Is there a way of creating a dummy column on my SQL statement to hold the record numbers of all records ..[1 to n] etc ???Id like to know how to do this and then I can get the MAX record number.Im using SQL server 2005 so the last() function doesn't work.

View 3 Replies

Web Forms :: Is GUID (globally Unique Identifier) Unique

Aug 25, 2010

Is GUID (globally unique identifier) really unique, or it can be duplicate.

System.Guid.NewGuid().ToString()

View 6 Replies

DataSource Controls :: Insert Row Only When A Certain Field Is Unique?

Jan 3, 2010

For example: INSERT INTO table (col1, col2, col3) VALUES ('value1','value2,'value3')But I would only like to insert the row if value3 isnt already present in col3 in some previous row. What is the best way to do that?And the insert command is run 50+ times in a loop (with different values each time for value3)

View 4 Replies

ADO.NET :: User ID Convert From String To Unique Identifier?

Aug 6, 2010

How do I convert a string to a uniqeid data type?

I'm identifying a logged in user. I use this code:

[Code]....

[Code]....

When I go to insert form data with LINQ to SQL, says it can't due to string not a unique id.

View 2 Replies

Security :: Membership - Getting A Unique Identifier For User

Feb 22, 2010

I realize that user names are unique, but is there another identifier associated with the username? If there is, how do I find out what it is for the user who is currently logged in?

View 2 Replies

VS 2010 - Having Email Address As Unique Identifier?

Mar 5, 2012

I'm creating a website with sql server db (built in membership database). I design it best possible. Im reluctant to use text fields as identifiers, but this is pretty much my first sql server db.

1. The user registers himself, at the same time registering his company/organisation. I dont think many of them will have the need to register themselves to other companys (N:N) but you never know (anyway not a main concern at the moment).

2. This user becomes a superuser (level1), with the ability to register other users to the same company (level2 users). Finally level1 can register level3 users to the same company.

So you see the identifier will be everywhere in the sql commands. There are quite a few N:N relations as well, which I guess slows it down even more. The selections typically retrieves a few hundred to a few thousand posts, but like I said, many will be in N:N relations.

View 8 Replies

How To Creating Unique Identifier Base On Client Header

Jan 4, 2011

I'm going to write my own Authentication module and I need a unique identifier base on users requests header , I think [(user IP)+(user Agent)] can be reasonable but I know it's not completely safe do you know any other options or methods?

View 3 Replies

The Page Falls Over Saying It Cannot Convert String To Unique Identifier?

Feb 17, 2011

in the code in front i have:

Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SQL2008R2_799650_xnacsConnectionString %>"
SelectCommand="SELECT [ArticleTitle], [articlehtml], [submittedby], [datesubmitted] FROM [Articles] where articleid ='@id'">
</asp:SqlDataSource>

and code behind is taking a url param (guid) and passing it to the select above
it looks like this:

Code:
protected void Page_Load(object sender, EventArgs e)
{
string id = Request["article"];
as simple as that, the problem is the page falls over saying it cannot convert string to Unique identifier, I'm new to asp.net but not c# so there are a few bits i'm trying to get my head round..

View 4 Replies

State Management :: Creating Each Session Key As A Unique Identifier?

Jun 28, 2010

First of all here is my code chunk.

[Code]....

Right now I am creating this session with the session key "PhonePart" which is also the name of object I am passing in as a parameter in first method. In subsequent methods, I use the the same name to retreive and clear session value. My problem is, this approach works fine If I instantiate a single object of the class where these methods are defined and using that object call the methods, but when I create another instance of the same class and calls for instance method AddToSession and pass that instance, it overwrites the session value stored by the first instance of the class as the session key is the same that is "PhonePart".

Considering this scenario, is it possible that I somehow grab the name of the object as string in the calling method say "AddToSession" and create a session with that name? If Yes, then I can do the same in subsequent methods and retreive session value and also clear the session specific to that instance name without affecting the other session values stored by other instances.

View 5 Replies

Security :: Membership And Active Directory Unique Identifier?

Feb 16, 2010

i have a web application with form identification agains ActiveDirectory. The user is added to the aspnetdb and then we add his roles and profile.heres my question. If you have a user with "abcdef" for his sAMAccountName and then this user quit the job and someone else came in and we give him the SAME sAMAccountName, how aspnet will react? i guest it will see that the sAMAccountName already exist in the aspnetdb and will use it? if its true, then i will have a problem that the new user will inherit the old user access and profile!how can i solve this? i know theres a objectGUID attribute in AD that i can use but how can i use it with aspnetdb?

View 2 Replies

SQL Server :: How To Create Unique Identifier To A Geometry Table

Mar 9, 2011

I need to insert geometry data to sqlserver 2008 with RowGuid UNIQUE IDENTIFIER as primary key.

View 1 Replies

C# - How To Write A Stored Procedure That Generates A Unique Identifier

Mar 10, 2011

writing the stored procedure that autogenerate the number like...

ABC0000001

It should happen for each entry we make through asp.net page. I mean for each time when the page loads it should create this unique number.

View 6 Replies

Find Unique Identifier From Selected Item In ListView?

Sep 1, 2010

I'm using a ListView and have two buttons that allows users to delete or edit a item from the list. Below is the code for the buttons:

<td>
<asp:ImageButton ID="ButtonEdit" runat="server" ImageUrl="~/Styles/Images/Edit.png" ToolTip="Edit" OnClick="ButtonEdit_Click" />
<asp:ImageButton ID="ButtonDelete" runat="server" ImageUrl="~/Styles/Images/Delete-Red-Cross.png" ToolTip="Delete" CommandName="Delete" />
</td>

When the user clicks the edit button I want to pass the unique identifier from the item in the list to the parameter string so I can retrieve it in the edit page. how to retrieve the ID from the selected item?

View 2 Replies

Web Forms :: Generate A Unique Identifier Or Reference Number Based On A Format?

Jan 22, 2010

I need to generate a Unique Reference number that has 7 digits.

It should be formatted in the following way:

1st: B (Ball), G (Gift), C (Cat)

2nd: represents year of booking A(2010), B(2011),C(2012), etc

3rd: represents the month of booking J(Jan),F(Feb),M(Mar),A(Apr),Y(May), U(Jun), L(Jul),G(Aug), S(Sep),O(Oct),N(Nov),D(Dec)

4th: days of booking A(1st) - Z(26th), 1(27th) - 5(31st)

5,6,7th: These are counters for the number issues each day. Each can be A-Z,0-9 giving a total of 46,656 combinations. So 0 is first, then 1, 2, 3, 4, 5, 6, 7, 8, 9, A-Z, then 00 to 0Z, then 10 to 1Z, then 20 to 2Z, etc

Now , the 1st Digit is a Character that I generate based on a condition and that shouldn't be a problem.

View 1 Replies

Forms Data Controls :: How To Keep The Previous GridView Field Value And Then Concatenate New Ones

Sep 10, 2010

I have a Timer and a GridView who pulls info from the database every X seconds.Every time I query the database the field 'Comments' is replaced with whatever is on the database (since it's bound to it). I'd like to keep my previous value and keep adding into my Label the subsequent values queried from the database.

For instance, first time I query I get a value of "1" in the Gridview. Now someone changes the database row and next time I query it I have a value of "2". Well, I would like to concatenate the last value queried with the previous one and so on.

So at this point the GridView should show "1" and "2". Here is the piece of code I am talking about:

<asp:TemplateField HeaderText="Comments" SortExpression="Comments">
<ItemTemplate>
<asp:Label ID="lblComments" runat="server" Text='<%# Bind("Comments") %>' />
</ItemTemplate>
</asp:TemplateField>

How do I achieve this goal?

View 11 Replies

Forms Data Controls :: How To Concatenate Text In Template Field

May 25, 2010

I am just trying to concatenate two separate data columns into a single template field but no luck yet.

[Code]....

I can use two different labels inside single template field but I want to know how it is done.

View 4 Replies

DataSource Controls :: Concatenate TableName With Int?

Jun 7, 2010

I have the following code:

[Code]....

In this line, I wanted to assign the table to the datatable of dtCA1 and dtCA2.

View 2 Replies

DataSource Controls :: Concatenate The Multiple Columns In Linq?

May 8, 2010

how to write that below query in linq

DECLARE @Name varchar(20)

Select @Name = empFirstname+','+empLastName+','+empBankCode From srpEmployee
PRINT @Name

View 7 Replies

Crystal Reports :: Concatenate In Formula Field Or SQl Query?

Sep 28, 2010

I need to concatenate address string. Is it better to concatenate using the formula field or concatenate in the Sql query itself? which one would be faster?

View 1 Replies

ADO.NET :: Convert SQL Concatenate To LINQ Concatenate Query?

Oct 20, 2010

convert the code below to LINQ, converting my project to a wseb version usimg LINQ To SQL. The project contains 10 textboxes to possibly select from, but I'm only providing the first two textboxes to simplify my question.

mySQL_Statement = "SELECT IDENTIFICATION_DATA.NSC,ITEMISCD.RNC,ITEMISCD.NSC1 FROM IDENTIFICATION_DATA LEFT OUTER JOIN ITEMISCD on IDENTIFICATION_DATA.NIIN = ITEMISCD.NIIN"
If Not ((TextBox1.Text = String.Empty) And (TextBox2.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " where "
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "IDENTIFICATION_DATA.NSC IN (" + TextBox1.Text & ")"
End If
If (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "isnull(IDENTIFICATION_DATA.NIIN) = FALSE"
End If
If Not (TextBox2.Text = String.Empty) Then
If astrixState = 0 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
ElseIf (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
MsgBox(mySQL_Statement)
End If
End If
If astrixState = 1 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " OR IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
Else
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
End If
End If
If astrixState = 2 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")"
Else
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")"
End If
End If
End If

View 12 Replies

DataSource Controls :: Multi-part Identifier "t.fk1" Could Not Be Bound?

May 18, 2010

there is a statement like " select t.f1, (select ta.f2 from ta where t.fk1=ta.fk1) from t inner join ta on t.fk1=ta.fk1 "? In SQL 2005, this will get the message "The multi-part identifier "t.fk1" could not be bound.".beacuse the result will contains duplicate data from table ta in one row.

View 7 Replies

Concatenate Two Columns In Subsonic Datasource?

Mar 20, 2010

Does anyone know how I can concatenate two columns in my subsonic datasource? I want to display a first and last name in this dropdownlist but I don't want to put them in the same SQL column.

View 2 Replies

DataSource Controls :: Columns Don't Currently Have Unique Values?

May 3, 2010

I am returning a dataset from a method and trying to set one of the columns as Primary Key.

CategoryList.Tables[0].PrimaryKey = new DataColumn[] { CategoryList.Tables[0].Columns["CategoryNodeId"] };

Interestingly it gives me this error at run-time, These columns don't currently have unique values.

Now I perfectly know why this error should error, but there are no duplicate keys in this data column. I broke the code in between and bound the dataset to gridview to check if this column contains any duplicates and this is not the case. Here is the result set underneath. Have a look at the first column 'CategoryNodeId'.

CategoryNodeId
CategoryId
Name
ParentCategoryNodeId [code]...

unable to find a work around for now.

View 3 Replies

Asp Mvc Datannotation Unique Field

Jun 21, 2010

i followed [URL]. it was fine till server side but how would i be applying client side validation for unique field validation scenario on for example say username. i want to have username as unique.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved