|
Please don't post questions twice, your last post comes down to the same question and I answered it there.
Standards are great! Everybody should have one!
|
|
|
|
|
|
How to get the number of all elements in XML file using DOM?
|
|
|
|
|
Hi
I have the following code which checks what the last number is in a database field after the _ and then adds 1 to it. however i need to add an extra bit of code in to check if a number exisits there already as the field could be: xxxx~xxx_01 or it could just be xxxx~xxx without the underscore. if its the latter then it will need to start from 1 and incrment up from there adding an underscore to the field where as at the moment it checks if there is a 1 there already,
any suggestions?
hope this makes sense, comment if not
cheers
SqlCommand cmd17 = new SqlCommand(test0002, con2);
StringBuilder htmlStr_room_code2 = new StringBuilder("");
SqlDataReader reader2 = cmd17.ExecuteReader();
while (reader2.Read())
{
htmlStr_room_code2.Append(reader2["room_code"]);
}
lbtest2.Text = htmlStr_room_code2.ToString();
Session["sessiontest1"] = lbtest2.Text.ToString();
string db = Session["sessiontest1"].ToString(); // "jh00~pr11_01";
string[] split = db.Split('_');
string s_number = split[1];
int i_number = Int32.Parse(s_number);
i_number++;
s_number = i_number.ToString();
db = split[0] + "_" + s_number;
|
|
|
|
|
Once you have your db string you can use if(db.Contains("_")) and go from there.
Standards are great! Everybody should have one!
|
|
|
|
|
I am developing an windows application and i want that when system starts application automatically run.
I know that may be done by using windows services but i am unable to do that.......
So please help
|
|
|
|
|
The answer's on the first page I got when searching on
Google[^] :S.
Standards are great! Everybody should have one!
|
|
|
|
|
|
as you've got answers concering windwos services:
I don't think you want to write a service-app. (services shouldn't use GUIs! - aka forms etc.) - you just want to start the app on starup? - Well put a link into your autostart (startup whatever) - folder in your start-menu!
|
|
|
|
|
... or (if the service is unecessary) put the path to your app in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Value name: Your App
Value Data: Your_App_Path
|
|
|
|
|
i have a windows control which is to be loaded on a webpage(.aspx page)
control is loaded with the aid of "object" tag
the control is developed in C#.net(managed code basically)
the control makes use of the system resources and even makes use of some other dll's too
problem:
the control fails to load on the webpage
first solution tried:
change the .net security with the aid of caspol
so i tried giving full trust to all code
this worked fine and the control got loaded.
however this worked fine only when the webpage was a part of the default website in IIS
in case if the webpage which hosts the control is a part of a virtual website apart from the default website
the control is failing to load
so what might be the problem...??
from some of the blogs which i read...the .net tries to give trust
to assemblies based on from where the assembly is getting streamed
so i also tried to load the control by making this site a trusted one
still the control didn't load
any idea...as to might b wrong....
|
|
|
|
|
naveen1382 wrote: have a windows control which is to be loaded on a webpage
Right there is probably your problem...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: Right there is probably your problem...
Why's that then?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I've been working on something very similar recently, and having almost identiacal problems!
I'm a lil confused by your post however - what do you mean by Virtual Website? Do you mean that the folder you're hosting the control in is a virtual directory, configured in IIS?
If this is the case, you shouldn't be having any problems - but of course we always do! Some things to check would be to ensure that the control is actually being served by IIS - I had issues with the control not being downloaded. Simplest way to check is to clear out temp internet files, navigate to the page, then check that the .dll has appeared in the folder (View files from IE Tools-> Internet Options) If it hasn't appeared, then the problem is with IIS, if it has, then probably a security issue.
If it isn't being served, check that the application's Execute Permissions (IIS Admin -> Site Properties) are set to Scripts only - i had mine set to Scripts and Executables, so when requested, IIS was treating my dll as an exe, and attempting to run it rather than serve to the client.
If it's a security issue, it may be that the evidence you're using isn't quite right. Most of the docs recommend using strong name evidence. The problem with this is that is causes stack walk problems with the app domain. I used site evidence, at the all code level, by issuing:
caspol -m -ag 1 -site www.mysite.com FullTrust -n MyGroupName
This creates a sub group of the All code group at the Machine level, granting full trust to anything from www.mysite.com.
Hopefully this helps
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi
I have the following code which is supposed to increment 1 but it seems to be incrementing by 3
any suggestions?
cheers
string maxquery = "Select max(activity_order) from roomactivitylk where room_code = 'v1106'";
int max;
SqlCommand cmd15 = new SqlCommand();
cmd15.Connection = con;
cmd15.CommandText = maxquery;
max = Convert.ToInt32 (cmd15.ExecuteScalar());
max = max + 1;
++max;
max++;(needs to only be one of these)
modified on Monday, December 10, 2007 4:41:39 AM
|
|
|
|
|
Jamie1985 wrote: max = max + 1;
++max;
max++;
Each of these lines increments max by one.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Jamie1985 wrote: max = max + 1;
++max;
max++;
Why do you write like that?
use only one. eg. max++;
|
|
|
|
|
thanks managed to sort it, you were right
cheers
|
|
|
|
|
If that was really your problem, you can't have possibly written the DB code you posted ? You should buy a C# programming book and work through it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Jamie1985 wrote: I have the following code which is supposed to increment 1 but it seems to be incrementing by 3
Why you given it 3 times ?
Jamie1985 wrote: max = max + 1;
Increments 1 to max value
Jamie1985 wrote: ++max;
Pre-increment. max value won't be changed
Jamie1985 wrote: max++;
Post-increment. Same like the first one.
|
|
|
|
|
N a v a n e e t h wrote: Pre-increment. max value won't be changed
I thought it would, it just works in a different order, like:
int a;<br />
int b = 4;<br />
int c = 3;<br />
<br />
a = b++*c;<br />
<br />
b=4;<br />
c=3;<br />
<br />
a = ++b*c;<br />
I'll have to go check now.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
SK Genius wrote: I thought it would, it just works in a different order, like:
OOPS, I am wrong. Whatever you said is correct.
|
|
|
|
|
Hi
I need to draw images into the device screen using filter graph is it possible?
Regards
Sheeja. A.L
|
|
|
|
|
Hi,
iam doing windows application in c#
my windows form consists of textboxes,lables,buttons and datagridview control..
now i want to print the form...is there any code for both form controls and datagridview control printing ....
thanks in advance..
with regards
murali
murali krishna
|
|
|
|
|
1. Use BitBlt API or PrintWindows API to capture the screenshot of your window form.
2. Save it as image in your memory stream or disk.
3. Print this image.
Example : Printing a Windows Form[^]
Hope it helps.
|
|
|
|