|
after the Insert query fire
Select scope_identity()
This will return the last inserted identity
|
|
|
|
|
|
If you are executing your INSERT command in a stored procedure, you can assign ID value of the inserted data to a local variable.
Example:
declare @returnID
-- here goes your insert statement
set @return = @@identity
With this you have the value of the ID in the local variable, that you can return o your code as return parameter from the stored procedure.
|
|
|
|
|
I mistakenly posted this thread in asp.net
|
|
|
|
|
|
Hello every one.First of all i am describing my requirment.
Atually in my application i have a treeview controle.TreeView has a Context menu which has option Add item,Delete item,Edit item.When an user select Add New item then there is a window popup.by which user can enter new node.But problem is that i need user selected node for keep as parent node when he click on tree view for add new node as child node.
i am not getting the value of node on which right click and want add new child node.
How can i get it .please help me.
|
|
|
|
|
When u click on left side root u get the Root Node, now select this Root node and then click the "Add Child Node" option.
It solves ur problem
|
|
|
|
|
I am using vs2008, on website tab--> ASP.net configuration in VS.
When i create new website.
Its giving error "An error occur ........", on same page, when i click on link on top right of page "How do i use this tool?", its saying tool has been time out.
But when i open already created website in which i used this tool, its working fine, no error !!
Any help
regards
|
|
|
|
|
Can you please explain "An error occur...."
Without any clue no one can help you.
|
|
|
|
|
anu_anu jee ko pranaam
problem is when i use asp.net configuration tool of VS2008,
file-> new -> Website
It says "An error has encountered, please return to previous page and try again"
But,
File ->open -> website (here if i open already created)
when i click same ASP.net configuration tool, its working fine?
Now any help anu_anu !!
|
|
|
|
|
Hum Dum wrote: How do i use this tool?"
try the following videos
http://www.asp.net/learn/videos/video-47.aspx[^]
http://www.asp.net/learn/security-videos/[^]
Hum Dum wrote: I am using vs2008, on website tab--> ASP.net configuration in VS.
When i create new website.
Its giving error "An error occur ........",
i am not getting what u trying to say May be if u want to use ASP.net configuration in VS. in solution explorer on the top right hand side there is hammer like tool .First try to understand the tool
If It Helps Click It as Answer
|
|
|
|
|
hii can anyone give me idea how to generate the textbox and labels dynamically....
|
|
|
|
|
See this[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
you mean in the client side, or in the server?
if in the client side use :
var elem = document.createElement('input');
elem.type="text";
document.appendChild(elem);
If you mean the server side Textbox use :
create a panel called say pnl
create object of TextBox;
TextBox tb = new TextBox();
pnl.Controls.Add(tb);
Hope you got it.
|
|
|
|
|
mylogics wrote: ow to generate the textbox and labels dynamically.
Manash and Abhishek has already give you the answer.
I just wanted to add one more point that you should now at the time of creating dynamic control.
The control which you are creating, you need to created before Page_Load( ), other wise, it will not able to maintain the View State Data or will not load the Postback Data.
If you deeply look inside ASP.NET Page Life Cycle, Before Page_Load( ), there are two different methods calls. 1) LoadViewState() and 2)LoadPostbackData( ).
So, if you create any control on Page_Load() , or after that it will not able to load the data.
So you need to create such control either in Pre_Init( ) or Init() method.
Though there are workaround to add the Control which are created after page_load into Control Tree for maintaining viewstate and Postback, using Catch up. I am not discussing that over here.
Hope this will help you in longer run
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
yes... great info friend...
Cheers.
|
|
|
|
|
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I got the following error when i try to browse my asp.net website from local IIS 5.1
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
I tried the support provided by MS iis help but it didn't help me.
plz give me any solution which can work
|
|
|
|
|
Did you registered ASP.NET Framework with IIS ?
Goto command Prompt> Goto Framework Directory >
Run aspnet_regiis -i
Then try to access your application.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
HI,
I created a html table with number of td and tr dynamically. I created as runat server
eg:
string html=
html += ";
Div.InnerHtmnl = html;
now i want to findcontrol of the table and set visible false in a button click event.
I use FindControl("tbl1").Visible= false, but it is not working.
Thankyou,
YPKI
|
|
|
|
|
yesu prakash wrote: string html=
You can't create a server control in this way. You may need to work with the Table[^] control class. Make sure you understand the viewstate issues before working with dynamic controls.
|
|
|
|
|
The problem is you cant write runat="server" as HTML. Actually when you write a basic html with runat=server, it actually creates an object of the control in the server and calls its RenderControl to get its output.
You can define your CustomControl as well to have the same situation.
So if you want to set the html dynamically, always write w3 standard html scripts.
|
|
|
|
|
Using UploadFile control to upload file to the server fails, if I upload twice the file with the same name with exception that path is not accessible coming from either UploadFile control or from File.Delete if I'm trying to remove it before uploading it again.
1) Clicking [browse] button, selecting the file, uploading it with say UploadFile.Save("path\file.txt"), and do some processing on the file.
2) Clicking [browse] button, selecting the same file, I try to upload the same file.txt to exactly the same location on the server UploadFile.Save("path\file.txt"). And the exception is returned.
I do not have such problems on my local computer.
Чесноков
|
|
|
|
|
Always add the exception message in your questions..
|
|
|
|
|
When uploading a file to server try to attach a GuId with the filename so that we can avoid file duplication problems.
|
|
|
|