|
Get the value that returned
Thank !
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[Proc_Scenario_GetMaxID]
(
@MaxID int OUTPUT
)
as
if exists(SELECT [ID] FROM student)
SELECT @MaxID = MAX(ID) FROM student
else
SET @MaxID=1
----------------------------
Because '@MaxID' is OUTPUT
So Your stored procedure...
----------------------------
Chinese programmers: 狼人软件
|
|
|
|
|
REATE PROCEDURE Proc_Scenario_GetMaxID
@MaxID int OUTPUT
as
BEGIN
if((SELECT MAX(ID) FROM student) is not null)
begin
SET @MaxID = (SELECT MAX(ID) FROM student)
return 0
end
else
Begin
SET @MaxID=1
return 1
END
end
code for execution :--
declare @i int
exec Proc_Scenario_GetMaxID @i output
print convert(char(4),@i))
|
|
|
|
|
Hello,
I want to create a simple alternative of PowerPoint slides.
I'll try to explain what I want to program.
I want a form that displays some slides which the contents are stored in the database. This can be a simple text, image or a video. I also want to have a kind of Marquee on bottom of the form. I thought about using DirectX for smooth Marquee, but don't know if that will be the best option. So I want to ask you guys what I better can use.
Greetings,
Abadi
|
|
|
|
|
I'm not saying that what I am going to suggest is 'better' than DirectX, in terms of smoothness and control DirectX will probably be 'better'.
If you go to the Code Project Home Page and type c# marquee into the search box at the top you will find several 'marquee' controls. Have a look at the code they contain and see if you can use it.
Also on MSDN there is an example Walkthrough: Creating a Windows Forms Control That Takes Advantage of Visual Studio Design-Time Features [^] that includes a marquee control.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
Check the value of xcontrol. If it's never anything other than 0 or 1, then you'll keep calling Lhesaplax and never hit your base case to exit the recursion.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Don't delete your message - how rude, after you got the help you needed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I need to read a file from over 200 pcs on our network using a C# application. This file might not exist so creating it is an easy process--just running a command from the command line on remote pc. I found a tool called psexec which allows running commands on remote pcs: I simply use this tool and run the command. However, it takes very long and I have to keep checking if the file exists. If I run the command on the remote pc right at the remote pc then it is instantaneous.
Is there a better alternative? I simply need to do the following:
1. Check if a file exists and delete it.
2. Recreate the file by running the command on remote pc.
3. Read the file.
I am sure others have had to do this before.
CodingYoshi
Artificial Intelligence is no match for Human Stupidity.
|
|
|
|
|
Hello Every one,
I used this Line to insert a new row in the orders table :
ordersTableAdapter.Insert((int)cmbClients.SelectedValue, DateTime.Today, totalPrice, amntPaid, rest);
I want now to know the PrimaryKey of this inserted row
Thanks in advace
All You Need Is A Good Friend
|
|
|
|
|
Assuming that your Primary Key Column is an Identity column this[^] might give you some ideas. At the very least, some terms to google for.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Dear all,
I made a Setup Wizard project in Visual Studio C# and set the "serial number" to true to protect my software; however, if the user input all "7", the serial number will always be valid
I wish after the installation, the software could read the serial number input by the user somewhere from the user's computer so that the software could check the serial number again (by some other algorithm made by me, other than the one that sum and divide by 7).
Any one knows how to do this? I will really appreciated if you could provide me some sample codes.
Thanks a lot!
coco
|
|
|
|
|
|
We have put in 30+ hours of research on this one and are still trying to figure out what the correct development path should be. It's time to ask for some experienced help.
What we need is to create a control that renders predefined 3D models of robots which we can drop onto C# and VB.net forms. The control would expose basic robot control to the form and programmers. For example:
- robotcontrol.arm.joint(2).position = 45
- a form button that toggles wireframe view
- clicking on the control can output 3D coordinates of where the users mouse is for us to incorporate feedback control etc.
We aren't game developers so building a 3D world inside a control from scratch is a rather daunting approach. I have scoured the internet for 3rd party tools that can help build this control and leadwerks is the only thing I've found that's close. I've also found one program that is made for adding 3D CAD viewers to .net applications. It works well, but lacks the ability to create any kind of parent/child relationship between the parts. For every degree of movement on any appendage you have to redraw the entire scene. That is a math and CPU nightmare for complex robots.
I have been learning Blender and we can import our CAD file parts into the program and I'm learning constraints to connect them together. Blender can export as .X directX files. It seems we can model a robot this way, but here's where we get lost. What is the way to bridge having a Blender model and creating a .NET control for it? There doesn't seem to be any examples, tutorials, etc out there for bridging these two worlds.
So I wanted to ask the community how they think this could be best developed. Any sage wisdom on this?
Thanks!
robot_builder
|
|
|
|
|
|
Hello every one,
I have sql server 2005 express edition installed and I created the database using it.I then developed a C# application that connects to this database. Now I want to deploy all of this to a client PC (only 1 client).
does he need to have SQL server installed ?
What steps should I do to deploy ?
Thanks
All You Need Is A Good Friend
|
|
|
|
|
Perhaps this[^] will help
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I was wondering if anyone knows if there is a way of avoiding duplication of documentation when using virtual methods and polymorphy.
If we use virtual methods properly they are overridden to do something in a different way, not to do something else, in a logical sense. Hence, the doc for an override should be the same as for the method it overrides.
Is there any way to avoid having to copy the doc to all the base classes? Obviously the doc should be pretty stable in a perfect world, but then again the world is often imperfect and it's a pain to maintain consistency this way...
[edit]
Btw, I apologize if the C# forum isn't the approriate one for my question. XmlDoc is a C# feature, even if VB.NET and maybe other CLS-compliant languages provide something similar nowadays, so I didn't know where else it might go. Please say so if you feel there's another forum that would be more appropriate.
[/edit]
|
|
|
|
|
In situations like that, I typically use the include tag like so:
<include file="xmldoc_common.xml" path="//method[@class='BaseClassName' and name='VirtualMethodName']/*" />
and the file will look like:
<xmldoc>
<method class="BaseClassName" name="VirtualMethodName">
<summary>The method does such and so.</summary>
<returns>A value depending on what happened</returns>
<exception cref="ArgumentNullException"><paramref name="paramA" />
is null.</exception>
</method>
</xmldoc>
This lets you share as many or as few tags as you want. If you want to have separate remarks for each, just leave the remarks out of the common and put them on each derived class that needs them. If you need some common remarks and some class-specific remarks, well I haven't really worked that out. I think I tried it once and ended up with two remarks sections in the Sandcastle output.
Only the summary, returns, exception, etc must match what is in the normal XML comments, all other tag names are whatever you want.
The external xml file goes in the project (not solution) root.
|
|
|
|
|
|
I have a windows forms application made with C# Express edition 2008, connected with a MySQL database on internet.
The application in this combination is usualy lightning fast, but after a certain period of inactivity (say 30 minutes) the application takes forever (say 60 seconds) for it's first response. After the first response the application is snappy again.
As most of the times the application is used in response to a customer request (either by phone or in person) it's very annoying looking at each other for 60 before continuation.
The probable causes are:
- usualy the connections to the database are reused, which means they don't have to be created every time a database connection is needed. The theory is that after a certain amount of time the connection is destroyed anyway.
Question:
Is this a plausible explanation, and if so how can I keep the connection with the database (I open the connection for every request, and close it immediately after completion so I don't intend to keep the connection open, but just keep the connection).
Somebody else told me it could be Windows swapping the application to virtual memory (== harddisk) after inactivity.
Question:
Is this a probable explanation, and if so how can I test this theorie, and again what can I do to prevent this behaviour ?
Thanks for any hints and tips
Rob
|
|
|
|
|
PosiRob wrote: The application in this combination is usualy lightning fast, but after a certain period of inactivity (say 30 minutes) the application takes forever (say 60 seconds) for it's first response
60 seconds it way to much for database connection problem. What OS are you using? I Know that Vista and Win7 has properties in advanced power management for IDLE HDD. That option make HDD shut down if nothing was read or write on it after period of time. Before I Discovered this setting my HDD needed approximately 1 minute before I could start using it
|
|
|
|
|
Thanks for this answer, my clients run mostly on XP, but it's not impossible that XP also has these "features".
I have XP/Vista and Windows 7 so I can investigate this theory, thanks for thinking
Rob
PS, I marked question by accident as solved. Other suggestions are still welcome.
|
|
|
|
|
Hello. I Just checked about that options, and it exists in WinXP. Under Screen saver tab, there are settings for power options.
I do remember this on Vista, because it was set to default to 15 minutes. And i have about 4 internal HDDs. And every time I attempted to access HDD after 2 hours of inactivity I got a very big system LAG due to HDD powering on. However I don't remember it affected HDD with OS installed on it
|
|
|
|