2 problems
-
Hi! I have a two problems: 1)How do i use messagebox in asp? (in C# project is MessageBox.Show("..."), but this doesn't work in asp). 2) In Microsoft Access is a field "autoincrement". Is there something like that in Mocrosoft sql server(that automatically increments that field)?
-
Hi! I have a two problems: 1)How do i use messagebox in asp? (in C# project is MessageBox.Show("..."), but this doesn't work in asp). 2) In Microsoft Access is a field "autoincrement". Is there something like that in Mocrosoft sql server(that automatically increments that field)?
x-trate wrote: 1)How do i use messagebox in asp? (in C# project is MessageBox.Show("..."), but this doesn't work in asp). Actually the C# won't work that way. If you do that in ASP.NET the message box will pop-up on the server and most likely hang it until someone clicks the button. You do NOT want to do that! You can use javascript to pop open a message box on the client.alert[^] x-trate wrote: 2) In Microsoft Access is a field "autoincrement". Is there something like that in Mocrosoft sql server(that automatically increments that field)? You can create an identity column in SQL Server like this:
CREATE TABLE myTable(ID int IDENTITY(1,1) NOT NULL, ...)
Does this help?
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
x-trate wrote: 1)How do i use messagebox in asp? (in C# project is MessageBox.Show("..."), but this doesn't work in asp). Actually the C# won't work that way. If you do that in ASP.NET the message box will pop-up on the server and most likely hang it until someone clicks the button. You do NOT want to do that! You can use javascript to pop open a message box on the client.alert[^] x-trate wrote: 2) In Microsoft Access is a field "autoincrement". Is there something like that in Mocrosoft sql server(that automatically increments that field)? You can create an identity column in SQL Server like this:
CREATE TABLE myTable(ID int IDENTITY(1,1) NOT NULL, ...)
Does this help?
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
Thanks! It helps a little! But... If i use an identity column like you just said then this will increment automatically when i add something else?(so if i use an insert command, i have to put in that command also this identity column or not)? And about the message box:for example, when i push a submit button, if a textbox is not filled in, then a messagebox should appear. I saw that there are some validation controls for this, but in order to do like i said i can use only Javascript? Thanks!
-
Thanks! It helps a little! But... If i use an identity column like you just said then this will increment automatically when i add something else?(so if i use an insert command, i have to put in that command also this identity column or not)? And about the message box:for example, when i push a submit button, if a textbox is not filled in, then a messagebox should appear. I saw that there are some validation controls for this, but in order to do like i said i can use only Javascript? Thanks!
x-trate wrote: If i use an identity column like you just said then this will increment automatically when i add something else( Yes. The numbers in brackets are the seed value and the increment value - but I've always kept them as (1,1) x-trate wrote: so if i use an insert command, i have to put in that command also this identity column or not? No, the column value will be created automatically. If you attempt to assign it yourself you will get an error. x-trate wrote: in order to do like i said i can use only Javascript? Yes, because the message box has to appear on the client. It won't do any good with the message box on the server.
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
Thanks! It helps a little! But... If i use an identity column like you just said then this will increment automatically when i add something else?(so if i use an insert command, i have to put in that command also this identity column or not)? And about the message box:for example, when i push a submit button, if a textbox is not filled in, then a messagebox should appear. I saw that there are some validation controls for this, but in order to do like i said i can use only Javascript? Thanks!
x-trate wrote: I saw that there are some validation controls for this, but in order to do like i said i can use only Javascript? No, the validation controls generate javascript for you. Either way, it needs to end up as Javascript, and run on the server ( MessageBox.Show will stop your server dead, as it will show on the server ), but you don't need to write any jscript to use validators, they know how to do that for you. Christian Graus - Microsoft MVP - C++
-
Hi! I have a two problems: 1)How do i use messagebox in asp? (in C# project is MessageBox.Show("..."), but this doesn't work in asp). 2) In Microsoft Access is a field "autoincrement". Is there something like that in Mocrosoft sql server(that automatically increments that field)?
Hi solutions for ur problems are as below. 1. there is no Messagebox in asp. If u want to show message as messagebox u have to use JavaSciptss alert() function. 2. In microsoft access there is autoincrement field. If u want to use something like that in SQL Server there is Identity field and Increment field. Use that to use increment number automatically by number which is given in the Increment field. If u problem will be solve reply me. Bye.. J. A. Patel
-
Thanks! It helps a little! But... If i use an identity column like you just said then this will increment automatically when i add something else?(so if i use an insert command, i have to put in that command also this identity column or not)? And about the message box:for example, when i push a submit button, if a textbox is not filled in, then a messagebox should appear. I saw that there are some validation controls for this, but in order to do like i said i can use only Javascript? Thanks!
You don't have to put the identitiy in the insert command, the sql server will automatically generate it. However, if you want to use that ID then when you create the insert commmand check the "refresh the dataset option", it will add a new select command and will update the dataset. Regards, Alexandru Savescu
-
Hi solutions for ur problems are as below. 1. there is no Messagebox in asp. If u want to show message as messagebox u have to use JavaSciptss alert() function. 2. In microsoft access there is autoincrement field. If u want to use something like that in SQL Server there is Identity field and Increment field. Use that to use increment number automatically by number which is given in the Increment field. If u problem will be solve reply me. Bye.. J. A. Patel