Click here to Skip to main content
15,910,981 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionTextBox to autopostback "automatically" when text.length = x Pin
suni_dotnet15-Mar-09 12:44
suni_dotnet15-Mar-09 12:44 
AnswerRe: TextBox to autopostback "automatically" when text.length = x Pin
Christian Graus15-Mar-09 12:55
protectorChristian Graus15-Mar-09 12:55 
GeneralRe: TextBox to autopostback "automatically" when text.length = x Pin
suni_dotnet15-Mar-09 13:41
suni_dotnet15-Mar-09 13:41 
GeneralRe: TextBox to autopostback "automatically" when text.length = x Pin
Christian Graus15-Mar-09 14:09
protectorChristian Graus15-Mar-09 14:09 
GeneralRe: TextBox to autopostback "automatically" when text.length = x Pin
suni_dotnet15-Mar-09 14:28
suni_dotnet15-Mar-09 14:28 
GeneralRe: TextBox to autopostback "automatically" when text.length = x Pin
Alok Sharma ji15-Mar-09 17:44
Alok Sharma ji15-Mar-09 17:44 
GeneralRe: TextBox to autopostback "automatically" when text.length = x Pin
Christian Graus15-Mar-09 18:32
protectorChristian Graus15-Mar-09 18:32 
QuestionUnable to get the Identity column value for new row in MSSQL database. Pin
AprNgp15-Mar-09 9:13
AprNgp15-Mar-09 9:13 
I am inserting a new row in a database table (MSSQL).
I want to retrieve the value of Identity column associated with 'this' new row.
My stored procedure is as follows :
ALTER PROCEDURE dbo.Insert
(
	@SubCategoryId tinyint,
	@text nvarchar(MAX),
	@Url nvarchar(2000)
)
AS
	SET NOCOUNT ON;
INSERT INTO Table1
                      (SubCategoryId, text, Url)
VALUES     (@SubCategoryId,@text,@Url)

SELECT NEWID = SCOPE_IDENTITY()


Now, I have a table-adapter in which i have any Insert function which uses the above stored procedure.

From the code-behind, i am inserting the data.
DataSetTableAdapters.Table1TableAdapter t1 = new DataSetTableAdapters.Table1TableAdapter();
        int result = t1.Insert((byte)int.Parse(ddlSubCategory.SelectedValue), txtText.Text, txtUrl.Text);


The row is inserted in the database, but the returned value is not the Identity column ...
Is the stored procedure incorrect ?

I posted this in ASP.NET forum, because i want to do this in ASP.NET, i found the stored procedure on a database related site, still the stored-procedure is not working ...

Apurv

“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)

“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)

AnswerRe: Unable to get the Identity column value for new row in MSSQL database. Pin
Christian Graus15-Mar-09 10:06
protectorChristian Graus15-Mar-09 10:06 
GeneralRe: Unable to get the Identity column value for new row in MSSQL database. Pin
AprNgp15-Mar-09 21:01
AprNgp15-Mar-09 21:01 
Questionhow to call Pin
JAYRAJ GIRI15-Mar-09 6:06
JAYRAJ GIRI15-Mar-09 6:06 
AnswerRe: how to call Pin
Expert Coming15-Mar-09 6:26
Expert Coming15-Mar-09 6:26 
GeneralRe: how to call Pin
Christian Graus15-Mar-09 10:19
protectorChristian Graus15-Mar-09 10:19 
AnswerRe: how to call Pin
Christian Graus15-Mar-09 10:18
protectorChristian Graus15-Mar-09 10:18 
Questionequivalent of string.contains(vs2005) in vs2003. Pin
bishwambhar_sen15-Mar-09 1:31
bishwambhar_sen15-Mar-09 1:31 
AnswerRe: equivalent of string.contains(vs2005) in vs2003. Pin
N a v a n e e t h15-Mar-09 3:50
N a v a n e e t h15-Mar-09 3:50 
Questionsetting DropDownList value Pin
liz315-Mar-09 0:44
liz315-Mar-09 0:44 
AnswerRe: setting DropDownList value Pin
Expert Coming15-Mar-09 5:44
Expert Coming15-Mar-09 5:44 
General[Message Deleted] Pin
liz315-Mar-09 5:50
liz315-Mar-09 5:50 
GeneralRe: setting DropDownList value Pin
Expert Coming15-Mar-09 5:52
Expert Coming15-Mar-09 5:52 
GeneralRe: setting DropDownList value Pin
Expert Coming15-Mar-09 5:53
Expert Coming15-Mar-09 5:53 
Questionfile reading and writing problems Pin
StarTrekCafe15-Mar-09 0:31
StarTrekCafe15-Mar-09 0:31 
AnswerRe: file reading and writing problems Pin
Mustafa Ismail Mustafa15-Mar-09 4:00
Mustafa Ismail Mustafa15-Mar-09 4:00 
AnswerRe: file reading and writing problems Pin
Expert Coming15-Mar-09 5:45
Expert Coming15-Mar-09 5:45 
AnswerRe: file reading and writing problems Pin
StarTrekCafe15-Mar-09 16:04
StarTrekCafe15-Mar-09 16:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.