GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET 2.0
Go To First  |  Previous Question  |  Next Question 
 ASP.NET 2.0  |  Question 31 of 161    Print  
How can we implement a Identity (SQL Server) call in an asp.net page?

  
Total Answers and Comments: 1 Last Update: September 23, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 23, 2005 10:26:40   #1  
Praveen Kumar        

RE: How can we implement a Identity (SQL Server) call ...
try { SqlParameter p0 p1 p2; cmd new SqlCommand(); cmd.CommandType CommandType.StoredProcedure; cmd.CommandText spo_sample ; //Param: Return Value p0 cmd.Parameters.Add( @RowCount SqlDbType.Int); p0.Direction ParameterDirection.ReturnValue; p1 new SqlParameter( @Samplename SqlDbType.VarChar 200); p1.Value Samplename.ToString().Trim(); cmd.Parameters.Add(p1); //Param: Output Identity Value p2 cmd.Parameters.Add( @Identity SqlDbType.Int 0 SampleID ); p2.Direction ParameterDirection.Output; conn.Open(); cmd.Connection conn; int cnt cmd.ExecuteNonQuery(); int rowCount (int)cmd.Parameters[ @RowCount ].Value; int rowIdentity p2.Value;}
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Server-side code run at the server. It is a seprated file from html page.Client-side code is processd by browser and run at the client side ...

Latest Answer : There is the ability to use both server side and client side code with in the code behind. Generally though the code behind is server side code. This code acts on Events that are fired that are not handled by the client side script.(JavaScript,vbscript, ...

Latest Answer : Validation can be done both client side and server side.The advantage of using client side validation is better performance than server side validation as there is no round trip in client side validation.The disadvantage of client side validation is all ...

What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

Latest Answer : sqlcmd.commandtype=storedprocedure;......;......;Add parameters.......;sqlcmd.ExecuteNonQuery(); ...

Latest Answer : try { SqlParameter p0, p1, p2; cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "spo_sample"; //Param: Return Value p0 = cmd.Parameters.Add("@RowCount", SqlDbType.Int); p0.Direction ...

Latest Answer : Page_initPage_LoadStatePage_ProcessPostBackDataPage_loadPage_ProcessPostBackEventPage_PreRenderPage_RenderPage_SaveStatePage_Unload ...

Latest Answer : In VB - Inherits In C# - Colon (:) ...

Latest Answer : 1. Basically for a SAO, the lifetime of the object is controlled by server, whereas for a CAO, the lifetime is controlled by the client.Below are definitions from MSDN. Server activated objects includes Single Call & Singleton.Single Call objects service ...

Latest Answer : Differneces between Single Call & Singleton.Single Call objects service one and only one request coming in. Single Callobjects are useful in scenarios where the objects are required to do afinite amount of work. Single Call objects are usually not required ...


 Sponsored Links

 
Related Articles

SQL Server 2005 Integration Services Review

SQL Server 2005 Integration Services using Visual Studio 2005 A Beginner s Guide SQL Server 2005 A offering of Microsoft Corporation for database management the SQL server 2005 is one of the powerful database management systems in the world Available for integration in almost any system that uses Mi
 

SQL Server Integration Services

SQL Server Integration Services Here is a sample chapter from Beginners Guide to SQL Server Integration Services Using Visual Studio 2005 by Jayaram Krishnaswamy Environment set up for Visual Studio 2005 with respect to SSIS and multiple tasking Connecting to Microsoft Access Text Files Excel S
 

Web Server

Web Server A web server can be a program or the computer itself which receives the requests from various other browsers and responds to those requests These requests are all requests that are being sent for some documents There are two kinds of web servers available The web server program and the
 

jQuery - Marking the Current Page

Learning jQuery Marking the Current Page Our pager can be made more user friendly by highlighting the current page number We just need to update the classes on the buttons every time one is clicked mosgoogle geshibot lang php" var pager ; for var page 0; page numPages; page pag
 

Client-Server Models and N-Tier Applications

Client Server Models and N Tier Applications One of principal objective of Client Server methods is to provide data to an end user However Client Server architectural methodologies are much more complex Client Server describes the process wherein a client program generates contact with a separate se
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

Web Services and Client Server Technology

Web Services and Client Server Technology Introduction to Distributed Computing The Internet and expanded network connectivity established client sever models as the preferred form of distributed computing When talking about Client Server models of networked communication using web services the broa
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

N-Tier Client-Server Architecture

N Tier Client Server Architecture Description of 1 Tier and 2 Tier Web Applications This article will discuss the various architectures of Client Server environments Perhaps the most influential Client Server environment is the Internet and its global users With the increasing use of web application
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape