So far it seems like I get something figured out then run into another issue... Anyways, I was finally able to grab an ID from a table and enter the value into a Label using this code:
[Code]....
Now i want to make things trickier by grabbing the last value enterd. Now there will possibly be multiple people using the application simultaneously, i think it is still possible to do this. Here is the statement that enters VALUES into the table that generates the CaseID that i want to grab from:
[Code]....
From what i have researched, I may need to do a WHERE some where to grab the @@IDENTITY. I am having trouble figuring out where the @@IDENTITY goes, and possibly the correct syntax as well.
I am developing a asp.net application and i am using SQL Server 2008. I took a IDENTITY column as Record_ID for detail table where i will have trillions of records per year. So just want to ask whats the largest number record id (identity) column can hold and in ASP.NET which data type i should use to handle record id as i am using this id as a reference to update the table data. I don't want to end up being trapped some day.
I need to retrieve the identity value after the record has been created for another datasource. I.E. When the record is created in SqlDataSource7 the identity value (4700) would be assigned to Label1.text and used in SqlDataSource8 to insert a new record.
How do I do this? In the CodeBehind retrieve the identity value using SqlDataSource7 Scope_Identity() and putting that value into the SqlDataSource8 ApplicantID column.
I just not created a new database with 2 tables in it. In a table, I have set a column as a primary key and trying to change its properties i.e. setting is Identity to YES, but am not able to do so.
I'm trying to import a few hundreds of data to a SQL server database table from Excell Spreedsheet. In the taable, I created Id as key that is identity. How can I solve identity when I import excel data to the database table.
I have a Stored Proceedure which DID return the Scope_Identity when this was executed in SQLServer 2000.
Now I am porting this over to SQLServer 2008, and this always returns 0, and not the Scope_Identity which it should.
Here is the Stored Proceedure which will pass null for the parameter @pProjId for an insert:
[Code]....
Here is the script which creates the hip_Project Table:
[Code]....
What do I need to change for SQLServer 2008?
Again, this executed fine in SQLServer 2000 and always returned the Scope_Identity as expected. This problem has come up with other stored proceedures as well for which I need the Scope_Identity returned.
For some reason the code, <% Response.Write(Request.QueryString["title"]); %>, does not retrieve the data in this case. It works fine if I put it in the title tag though.
I have a page where it is getting overwhelmed with code like:ar textBox = $get("<%=textState.ClientID%>");This requires me to have my JavaScript inside the page instead of nicely tucked in a js file. Is there a better approach to this?
document.getElementById doesn't work because then I end up with code like this: var textBox = document.getElementById("originDestinationControl_textState"); var textBox = document.getElementById("ctl00_ContentPlaceHolder_originDestinationControl_textState");
I recently moved a .net site from one machine to another, now for some reason one of the stored procedures is throwing an exception when attempting to insert!
Exception Details: System.Data.SqlClient.SqlException: An explicit value for the identity column in table 'dbo.tbl_Events' can only be specified when a column list is used and IDENTITY_INSERT is ON
BTW, the column in question does have the identity set to Yes in management studio
I was using originally SQL 2005, now its on SQLexpress 2008
I have an insert table with identity specification set. And I getthis error. I'm using a stored procedure to store it. How do I correct it. I'm also using a details view on my insert page.
Exception Details: System.Data.SqlClient.SqlException: Cannot insert explicit value for identity column in table 'Insert' when IDENTITY_INSERT is set to OFF.
I tried all that was suggested in the above link..but I just cannot see the Identity data type option in the drop down. How can I set one field as a Identity data type if I dont see it?
I have a registration form which is working perfectly well, I need to enhance it slightly from where it is. As it is users are able to register for an account wether the email has been previously used/allocated in the user db.A client side call to the IsEmailAvailable function works great, just not working correctly server side. Here is the code.
My function:
[Code]....
And my if statement:
[Code]....
So my question is, how can I pass the end value of the IsEmailAvailable function to my if statement correctly.
I'm using asp.net - I need to grab live data from a website. Here's an example:
[URL]
That website provides live data share prices. I need code to retrieve the share price from the website and display it in my own page. I know you can get share price widgets online but all I need is a simple way to retrieve the share price values.
In one of my web app's pages, the code behind needs to grab the UserId of the person logged in, so that it can then be inserted into a table which was added to the original aspnetdb.mdf. This table contains a column with a uniqueidentifier primary key which is in direct relationship with the aspnet_Users table; however I seem to have trouble retrieving the UserId. This table contains the additional information of a user which is not included in the provider, and it has a one-to-one relationship with aspnet_Users.
I hope this makes sense. I haven't written any code for it yet; I'm only at the thinking part of this stage. But my mind keeps going blank.(perhaps I need a break from the solution???).
I created a base Controller for the other Controllers to derrive from, and in that controller I overrode the OnActionExecuting method so that each time any Controller executes a method, I can run some code. In that code I added a value to ViewData, and in the Master View I want to either display certain items or not based on the value of the ViewData item set. The problem is, once I get to the Master View, the ViewData doesn't have anything in it. I am not sure what I'm doing wrong.
I have a drop down list control that I need to pull the value from in the code behind of the page, modify it and redisplay it. The modifying and redisplaying I've got no problem with, it's grabing the value from the drop down control.
In the tutorial I am doing I have been requested to change a field in the colums properties of a table. The ID column is currentl displaying NO and NO again for "is aIdentity. I can Highlight the values but cannot change to yes. either in the properties talbe or in the properties window on the right hand side of IDE interface. How do I change that value?