|
how can i got the version infomation about the sqlsever and any similar information?
should i use the WMI? but which class should i used in the win32_InstalledApplication?
|
|
|
|
|
Run this query:
SELECT @@VERSION
Or run this SP:
xp_msver
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
I want to get this information in my c# web application in the run time.
is the select @@version could complie and run in the c#?!
|
|
|
|
|
yes.
it will run.. this has no relation with the programming language used.
|
|
|
|
|
Please forgive my stupidity.
i just feel puzzle,how can i use the "select @@version" in the code? would you like to show a example?
Thank you very much
|
|
|
|
|
See SqlCommand in MSDN or search for it in this site or Google to see how to run commands and SP in SqlServer from your C# application. When I test @@version and that SP the second one return informations for me , don't know wht so I recommed second way to you.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Thank you very much.
i have studyed the WMI for several hours to get the os information and the sql information.
i am not conscious that i could get the sql server information from the sql statement.
So when you told me use "select @@version", i just think how can i use it in the WMI. i am sorry for it.
Thanks a lot!
|
|
|
|
|
I have written a C# Windows form with a panel on top of it. As the program runs, a directory is opened and for each image file in the directory a picturebox is dynamically created and loaded onto the panel. As I create each picture box, I give it a Click event handler (the same function for each picture box) where I want to bring up a SaveFileDialog. This all works fine, however, I cannot figure out how to get to the individual picture box that was clicked on so that I can access the image it contains during the event. Can anyone help?
Thank you,
Dustin
|
|
|
|
|
In your event-handler you have a parameter: object sender , use this.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Just cast the sender to a PictureBox and it will be the one that was clicked on.
private void PictureBox_Click(object sender, System.EventArgs e)<br />
{<br />
PictureBox clickedon = (PictureBox)sender;<br />
<br />
}
|
|
|
|
|
Thanks for the replies.
That was the solution I needed.
I thought it had something to do with the sender object, I had even tried casting it as a PictureBox but kept getting compile-time errors. I never even thought of making a new PictureBox object and assigning it. Thanks again.
Dustin
|
|
|
|
|
DustinMiles wrote:
I never even thought of making a new PictureBox object and assigning it
You are not actually making a new picture box object with the previous code. What is happening is that you are creating a reference to the picture box. The variable is a reference to, not a copy of, the PictureBox.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
How to set background Image of treeview in C#?
I try to code about this problem for long time , but i can't found anyway for set background of treeview in C#.
Anyboby help me , please !!!
|
|
|
|
|
If I rememebr correctly, the TreeView control doesn't support a background image, nor does it support a transparent background. You'd have to draw the control yourself to get an image to show through it or behind the actual tree that is drawn. I can't seem to find any examples of it, but you might want to look into overriding WndProc.
RageInTheMachine9532
|
|
|
|
|
This could be very ugly, if even possible. The Tree-View common control that the TreeView class encapsulates doesn't even support this. The poster's best bet is handling the WM_ERASEBKGND but I'd be willing to bet this wouldn't work.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm with you on this, but I can't spend a week researching one small feature of his project...
RageInTheMachine9532
|
|
|
|
|
hello , could anybody help me pls i'm trying to convert a 2d image of a terrain using opengl and C# into a 3d terain
thanks
MTSHEDID
|
|
|
|
|
It depends on what kind of 2d terrain you have. If your terrain is a bump map, like what you see on a globe, where different colors or intensities correspond to different heights, then all you have to do is set for each pixel in your 2d terrain a pixel of the same height in your 3d model. So for every point (x,y) in 2d, there would be a point in 3d (x,y,z=(intensity of(x,y))/(maxintensity-lowestintensity)*scale), where your scale is something you define. However you would have to define how to connect these points in 3d using GL.Polygons, GL.Triangles, etc. Your normals would be the cross product of dx and dy. If intense2d(x,y) corresponds to the color or intensity in your 2d terrain, depending on how its defined in your terrain map. Your basic code would be:
<br />
float maxint = maximum intensity in your 2d terrain.<br />
float minint = minimum intensity in your 2d terrain.<br />
float scale = maximum altitude/maximum intensity in 2d terrain.<br />
float zscale = scale*(maxint-minint)<br />
for each x and y in 2d image <br />
float dx= intense2d(x+1,y)-intense2d(x,y), dy=intense2d(x,y+1)-intense2d(x,y);<br />
Vector norm = cross(new Vector(1,0,dx), new Vector(0,1,dy)); <br />
Gl.glNormal3f ( (float)norm.x, (float)norm.y, (float)norm.z );<br />
Gl.glVertex3f ( (float)x, (float)y, (float)intense2d(x,y)/(zscale));
If you are putting this terrain onto an object, then you might not neccesarily want to set the height, but just the normals at their corresponding location, which is bump-mapping.
This is the basic idea, otherwise you would have to be more specific.
|
|
|
|
|
thank u very much i'll try it out right away
MTSHEDID
|
|
|
|
|
I've developed a Power Point add in which works well enough right now (except it doesn't interact with PowerPoint (other than the button on the toolbar) yet.
Essentially it automates some background processes for the creation of some multimedia.
In any case I've found it very difficult to find good articles and/or code examples out there for actually manipulating powerpoint itself (or any other office app for that matter).
Perhaps I've been entering the wrong search criteria...I don't know. In any case the C# Code Project community has been VERY helpful in the past, so I just wanted to ping your # minds for some reference materials be they web sites or books.
I *have* found several books out there but have not yet had a chance to look any of them over. So any recommendations would be great.
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
Ok, haven't read them yet but just noticed there are quite a few articles listed under Add-In's on the main page.
PS to webmaster (the search functionality could stand a tweak I think)
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
So my original question remains. All the articles I saw were for vb add-ins.
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
So? Don't you realize that VB uses automation, which is what the interop assemblies you'd use does? It's the same thing. The object model documented for any automation client like VB is the same which you'd use in .NET. If you're talking about VB.NET, then you don't seem to understand that different languages that target the CLR are only different syntaxes (some compilers support different levels of the CLI/CLR, however). All the languages compile down to Microsoft Intermediate Languages (MSIL), which is why the .NET Framework allows for so many languages.
For a true .NET developer, translating between VB.NET and C# should be no problem. If you're talking about VB6, then again I remind you that the automation object model exposed to clients like VB6 is the same that comprises the interop assemblies I mentioned in previous replies to your posts.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Oops, no I typed the wrong letter. I am well aware that they all compile to the same thing and use the same object structure. I meant VS as in Visual Studio Add-Ins. I am interested in Office Add-Ins. Specifically Power Point. I cannot seem to find many docs on automation of powerpoint (or office in general) from .NET
I already wrote an the add-in, so now there is an extra button on the toolbar when I run Power Point. The button when clicked opens a custom form but I am having trouble finding documentation on how to interact with Power Point from that form.
Specifically,
- How do I get a reference to the power point application so I can set my form's .owner property (or .parant)?
- How can I programatically make power point go into full screen mode?
- How can I read/set notes for specific slides in the current .ppt file?
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
The best object model documentation is actually in the programming help that is not installed by default (with a typical installation) of Office. Re-run set and choose the programming help files. MSDN Online doesn't have much for some reason. When your control is created, the context in which it's created is the ApplicationClass as it's known in the interop assembly for PowerPoint (one word, BTW). The add-in object model should already expose a way to get the running instance, such as an Application property. This is very common throughout the object model.
Microsoft MVP, Visual C#
My Articles
|
|
|
|