w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
how to get next Identity not the last inserted identity of Identity column
You don't need to do anything to "lock" an IDENTITY value. As soon as the table uses a value of an IDENTITY, it's used forever, even if you do a rollback. SQL Fiddle example: http://sqlfiddle.com/#!3/5fdb9/1/0. Note the ids that make it into the table, only 1 and 5. If that doesn't address your problem, please revise your question.

Categories : Sql Server

Finding out the current Identity Provider in Windows Identity Foundation
You typically use the Issuer and OriginalIssuer properties in each claim that you get. If you use e-mail as the unique identifier: var u = this.User as IClaimsPrincipal; var c = (u.Identity as IClaimsIdentity) .Claims .First( c => c.ClaimType == ClaimTypes.Email ); var issuer = c.Issuer; var originalIssuer = c.OriginalIssuer;

Categories : C#

Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?
That class is gone, as it was basically just adding methods that generated a ClaimsIdentity and passed that into an Owin.Security.IAuthenticationManager. Instead the RTM templates have a SignIn method in the controller that looks something like this: private async Task SignInAsync(ApplicationUser user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }

Categories : Asp Net

How to Alter a table for Identity Specification is identity SQL Server
You cannot "convert" an existing column into an IDENTITY column - you will have to create a new column as INT IDENTITY: ALTER TABLE ProductInProduct ADD NewId INT IDENTITY (1, 1); Update: OK, so there is a way of converting an existing column to IDENTITY. If you absolutely need this - check out this response by Martin Smith with all the gory details.

Categories : SQL

How to disable identity from the existing column & after adding data , how to enable identity again on the same column in SQL Server 2008?
Use SET IDENTITY_INSERT (http://msdn.microsoft.com/en-us/library/ms188059.aspx). SET IDENTITY_INSERT TableName ON; -- Insert Data. SET IDENTITY_INSERT TableName OFF;

Categories : Sql Server

How to map identity provider claim value to/from identity provider registered in Azure ACS?
I tried to do this last week and couldn't find a way to match the value in the claim to the value in IdentityProvider.js. I landed up looking for specific values. The only thing I can suggest is some resource/code that understands the mapping. I was just looking for a specific one and landed up doing something like this: return (HttpContext.User.Identity as System.Security.Claims.ClaimsIdentity).Claims .First(x => x.Type == "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider").Value .Contains("Google") I searched high and low for the data, but couldn't find it. If you do, please submit an answer, I would also like to know

Categories : Azure

Using @@Identity
You didn't show the code which does the INSERT into the other database. If you're using the Execute method of an ADO Connection object to do that, run the SELECT @@Identity query from that same connection object ... not a new connection with the same connection string. @@Identity is only usable within the same connection session; otherwise you'll get 0. And actually you don't even need a recordset to capture that value. If your connection object is named conn, this will return a recordset, but you need not assign it to a recordset object variable. Simply ask for the first item from the returned recordset. Debug.Print "most recent autonumber: " & _ conn.Execute("SELECT @@Identity")(0)

Categories : SQL

Identity Certificates
see this for more information Certificate, Key, and Trust Services Tasks for iOS on developer.apple.com

Categories : IOS

how to increment in mvc without identity
You're probably using a database. You can let the database manage your IDs. Generating unique identity numbers in a database is usually simple - you have IDENTITY columns in SQL Server, and all other databases have a similar feature. If you're not using a database, can generate a unique GUID - that's easier than maintaining a unique count.

Categories : Asp Net Mvc

Get Incremented IDs when Identity is not set
This is a kludge, but it may help you solve the immediate problem. In the long run, though, it's best to turn IDENTITY back on. DECLARE @Seed INT SELECT @Seed = MAX(Cust_ID) FROM <table_1> INSERT INTO <table_1> SELECT ROW_NUMBER() OVER (ORDER BY Dept) + @Seed, CustName FROM <TABLE2> WHERE Dept = 'Sales' AND Designation = 'Manager' However, this code is likely to break in spectacular ways if you execute multiple instances of it simultaneously.

Categories : Sql Server

ASP.Net Identity how to set target DB?
Here's a step-by-step on how to successfully change your database. First, clean-up anything you might have done previously. If there is any chance you might not get EVERYTHING, it would be best if you just started with a completely fresh copy in a new folder. Once source is 100% back to original state, ensure everything else is cleaned up, including deleting your "new" database and the original database (aspnet-AspnetIdentitySample-20130627083537_2). You can find the original database using the SQL Server Object Explorer. ("View" -> "SQL Server Object Explorer" in Visual Studio) Next, before you run your new application for the first time, go ahead and make the change to use your database name of choice. Here are the steps: 1. Set new database connection in web.config <connectionS

Categories : C#

How to specify sql server identity
Here is the syntax: create table tablename (ID_cli int identity(100,1), AdditionalId as '0001'+Cast(ID as Varchar(10))) Here Additional Id column will have ID values always prefixed with 0001. IDENTITY [ (seed , increment) ] seed:Is the value that is used for the very first row loaded into the table. increment: Is the incremental value that is added to the identity value of the previous row that was loaded.

Categories : Sql Server

ASP.NET Membership / Identity MVC 5
There is no built in equivalent for IsOnline currently, you could replicate that functionality by tracking the last seen time for your users and then adding a method which checked whether they have been seen in the last 5 minutes. We might add the last seen data to the default implementation in a future release.

Categories : Asp Net

Getting the right User.Identity
check the web.config to ensure <authentication mode="Forms" /> if you didn't set this explicitly, then you probably selected the mvc intranet template when you first created the project. once the config file is updated you will also need to create the login/off actions and views. you may want to create another project using the internet template and pull out the authentication components. intranet template defaults to windows authentication while internet template defaults to form.

Categories : Asp Net Mvc

Two identity columns
Read through this article and the ORMLite documentation; Multiple primary keys - ORMlite I'm not 100% sure on the answer by this. uniqueCombo = true seems to be a good guess, but i'm not sure if things such as Update and Delete still work then. You'd have to test it yourself.

Categories : Java

Replacing GUID PK with an INT IDENTITY PK
It's pretty simple, actually, when you follow these steps (I'm assuming T-SQL syntax is not a trouble for you): Remove PK (thus removing the clustered index) Add an nonclustered UNIQUE index with the 4 columns Add the IDENTITY column Add a clustered PK constraint for the PK

Categories : SQL

SQL SERVER Identity changes daily
Why is this a problem? Most likely there are 500 attempts to insert something and they all fail. It is not a must (and not the intention of the autoinc-column) to store consecutive numbers. It's intention is to provide unique numbers where each new number is greater than the previous thus giving a sort order on the insert sequence.

Categories : Sql Server

Confirm APK identity with keystore
I use this -- static public String getPackageFingerPrint( Context ctx ) { PackageManager pm = ctx.getPackageManager(); String packageName = ctx.getPackageName(); int flags = PackageManager.GET_SIGNATURES; PackageInfo packageInfo = null; try { packageInfo = pm.getPackageInfo(packageName, flags); } catch (NameNotFoundException e) { return ""; } Signature[] signatures = packageInfo.signatures; byte[] cert = signatures[0].toByteArray(); InputStream input = new ByteArrayInputStream(cert); CertificateFactory cf = null; try { cf = CertificateFactory.getInstance("X509"); } catch (CertificateException e) { return "";

Categories : Android

C# DataGridView with Identity Column
This parameter insertcommandDet.Parameters.Add("@nNewDetID", SqlDbType.Int, 4, "OrdDetID"); Needs to be specified as ParameterDirection.Output, i.e. something like the following lines of code : SqlParameter pID = new SqlParameter("nNewDetID", DBType.Int32, 4); pID.Direction = ParameterDirection.Output; insertcommandDet.Parameters.Add(pID); //** other code here... insertcommandDet.ExecuteScalar(); After you execute your command, you extract the value by int id = Convert.ToInt32(cmd.Parameters["nNewDetID"].Value.ToString()); You should be able to test this in a console application, to get you going... // set connection SqlConnection sqlConnection = new SqlConnection("[Your connection string here]"); // open connection

Categories : C#

Claims Based Identity
claimtest is an IEnumerable, you probably want to select only the first claim of the specified type and then use its value: var claimtest = claimType1 .First(x => x.Type == "http://identityserver.thinktecture.com/claims/profileclaims/company") .Value;

Categories : C#

Passing user identity from MVC to Web Api
You should use something like Kerberos delegation. The user will be authenticated in the MVC application using Kerberos then the Kerberos token will be passed to the Web API call. We do that currently at work to pass credentials from an ASP.NET app to an Exchange Webserver. It works fine. If you want more info check this KB: http://support.microsoft.com/kb/810572

Categories : C#

What should I do to set MS CRM to use other identity provider or are there any instructions on that?
I don't know if the CRM STS supports SAML directly - if it's similar to the SharePoint STS, it doesn't. The easiest way is to configure CRM with ADFS in the normal way and then federate ADFS with OpenAM. ADFS has full SAML support. Note that you need to use OpenAM's federation functionality.

Categories : Authentication

Resetting the next id in an identity column
When you delete records identity seed doesn't get reset. Check this tutorial: http://www.howtogeek.com/howto/database/reset-identity-column-value-in-sql-server/ DBCC CHECKIDENT (your_table_name, RESEED, 0) Also please note this rather strange behavior DBCC CHECKIDENT Sets Identity to 0

Categories : C#

Hibernate IDENTITY vs SEQUENCE
Though I'm personally new to Hibernate, from what I can recall, using Identity basically means that Hibernate will check what is the next possible id value from your DB and keep a value for it. For sequence, you basically tell Hibernate to generate the next value based on a particular sequence you provide it. So it has to actually calculate the next id by looking at the next possible id value. Hence, the extra query is fired.

Categories : Java

identity management in cloud
An app being deployed to the cloud has little to do with identity federation or identity as a service. You could very well use Forms authentication on a cloud service. The question is whether you want to make your app responsible for authenticating users or not. If you choose not to (which is likely a good thing), then you need to rely on a mechanism to outsource identity. The techniques to do this are referred to as "claims based identity", "identity federation", among others, and involve a number of protocols (e.g. SAML, SAML-P, WS-Federation, OAuth). These depend on the systems you want to use for authenticating users: SAML/WS-Fed are typically used for enterprises (using AD for example) OAuth is mostly used by consumer oriented systems (e.g. Facebook, etc). So, depending on where

Categories : Misc

SSL Certificate and identity verification
This is just a straw-man argument. The steps you have listed are completely imaginary. The actual steps are: The server sends its certificate as part of the TLS handshake. The server sends a digital signature over its certificate and the other handshake messages, signed by its private key. The client uses the public key in the certificate to verify the digital signature. Only a server that has the private key corresponding to the public key in the certificate can succeed. I suggest you do some reading, and not of random postings on the Internet: try the normative reference: RFC 2246.

Categories : Authentication

Add to User.Identity another property
You should examine ASP.NET Membership and Profile providers. Here is a link where it is explained in detail. User.Identity.Name will have whatever the user input on authentication (email or username, depending on your code).

Categories : C#

how to set the value to primary key identity column
If you want to add a column that's an IDENTITY column, use this command: ALTER TABLE dbo.YourTable ADD YourNewColumn INT NOT NULL IDENTITY(1,1) This will add a new column that's an IDENTITY column to your table, and it will assign values to that column for all existing rows. And to make it the primary key, use this command ALTER TABLE dbo.YourTable ADD CONSTRAINT PK_YourTable PRIMARY KEY CLUSTERED(YourNewColumn) Or if you want to, you can add it in a single command: ALTER TABLE dbo.YourTable ADD YourNewColumn INT NOT NULL IDENTITY(1,1) CONSTRAINT PK_YourTable PRIMARY KEY CLUSTERED

Categories : Sql Server

See if value of identity column is less than some number
Here are two ways you can do this: IF ((SELECT min(PKIdent) FROM dbo.MyTable) < 1) PRINT 'Its less than one' or IF exists (SELECT PKIdent FROM dbo.MyTable WHERE PKIdent < 1) PRINT 'Its less than one'

Categories : SQL

What is "Cannot verify Server identity" in iOS
Just some food for thought. If you are using NSURLConnection have you implemented the following. -(BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace{ } -(void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{ } Sounds like some authentication issue, Otherwise it could also potentially be your server's certificates is having issues.

Categories : Iphone

How do you unauthenticate User.Identity
Check this question in SO. It contains the answer to your question and a lot more useful information: What is the difference between Session.Abandon() and Session.Clear() in ASP.Net? Edit: and just to be more specific, Abandon is what you're looking for.

Categories : Asp Net

How to request new TOR identity in terminal
Have you set a control port in your torrc? To make it available via telnet you will need "ControlPort 9051". After that you will want to give tor a NEWNYM signal... $ telnet localhost 9051 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. AUTHENTICATE 250 OK SIGNAL NEWNYM 250 OK You can do this via a script using stem with... from stem import Signal from stem.control import Controller with Controller.from_port(port = 9051) as controller: controller.authenticate() controller.signal(Signal.NEWNYM) Thanks for the question! I've added it to stem's faq.

Categories : Osx

Where I can find documentation for ASP.NET Identity RC1?
i believe the only real documentation is replies on this forum. The structure of several entities have changed since the beta as well. I also could do with some more in depth information, particularly linking to your own custom user table having access to this custom table from the controller's User property access to the user and roles from a authorise attribute regardless of the actual login method (local,gmail,twitter etc)

Categories : Asp Net

Copy identity and put it to another table
INSERT INTO dbo.CS_RefQuestionChoice ( ChoiceDescription, QuestionID, RatingID, SetID ) SELECT choice, QuestionChoiceID, ratingid, 1 FROM CS_RefQuestions WHERE QuestionChoiceID = SCOPE_IDENTITY() I'm presuming a name of QuestionChoiceID for the identity column in the CS_RefQuestions table.

Categories : SQL

IIS 6 error with NETWORK SERVICE identity
Most likely NETWORK SERVICE user doesn't have sufficient access to the database. Try disabling any custom error handlers (like customErrors in web.config) and review the output. Or you may attach a VS debugger to w3wp.exe process and see exceptions before they're handled.

Categories : Misc

Identity specification in sql server 2008
Do you mean: CREATE TABLE dbo.YourTable ( ID INT IDENTITY(1,1) NOT NULL, ....other columns here..... Just use the IDENTITY keyword - you can specify a seed (starting value) and an increment - typically, both are set to 1 (but they don't have to). For more details, see the MSDN SQL Server Books Online documentation for IDENTITY If you need to have a non-numeric column that sort of behaves like an IDENTITY, I'd suggest you use the above approach, and then define an extra column like this: CREATE TABLE dbo.YourTable ( ID INT IDENTITY(1,1) NOT NULL, IDwithPrefix AS 'ST' + RIGHT('0000' + CAST(ID AS VARCHAR(4)), 4) PERSISTED, ....other columns here..... That way, your ID column will automatically get values 1, 2, 3, 4, 5....... and the IDwithPrefix column will have ST0001, ST0002

Categories : Sql Server

Can I use patterns like identity map in a stateless environment
Identity maps are used to implement the first level cache in many Object-Oriented Mappers. If your application stack involves Entity Framework or nHibernate (or yet another orm) most probably you already have an identity map there. But this is what you probably know already. The question whether or not an identity map could be static doesn't have a definite answer and I could probably imagine a situation where it could work but drawbacks are severe: the cache would not be able to easily see any external changes the memory consumption would grow without control concurrency issues could occur Implementation of an identity map which would be free of all these issues would probably be unnecessary difficult. It is just safer and less expensive to restrict the map's lifetime to a single req

Categories : Asp Net Mvc

How can I get early access to upcoming Asp.Net Identity changes?
We've started publishing nightly builds to the aspnetwebstacknightly myget feed. Currently the 1.0.0 RTM candidate version is already on the feed. Going forward as we start working on future releases, this feed will contain those previews as well. Update: Walkthrough post on how to get access

Categories : Asp Net

How to obtain a list of Users from ASP.NET Identity?
I found out that I wasn't using the derived ApplicationUser object for anything, so I just went ahead and changed all uses of it for plain old User. Then I just changed ApplicationDbContext definition for the following: public class ApplicationDbContext : IdentityDbContext< User, UserClaim, UserSecret, UserLogin, Role, UserRole, Token, UserManagement> { } And now I can access the user list: UsersContext = new ApplicationDbContext(); ... UsersContext.Users.ToList(); However, I think this will come back and haunt me in the future (I'll probably need to add more fields to User) so probably I'll have to use the same approach as in this question: Get all role names in ASP.NET MVC5 Identity system Edit: Since I got the need to add a new property, I had to revert my changes.

Categories : Asp Net

Decoupling Microsoft.AspNet.Identity.*
Yes this is a fully supported scenario, basically you will want to use exclude using the Microsoft.AspNet.Identity.EntityFramework dll which has the default EF implementation, but you should be able to reuse the Manager classes and just implement your own custom Stores using your own POCOs which the manager will use just fine via the interface. For RTM its been streamlined and simplified a bit more, I believe the RC version was not quite as streamlined yet. Updated You can get early access to the RTM bits here: MyGet

Categories : Asp Net Mvc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.