|
int Age = (int)dsABC.Tables[0].Rows[0]["AGE"];
|
|
|
|
|
Thanks for ur information
But what is the point of declaring AGE column as of type "int" while defining the table.
|
|
|
|
|
Hi,
I like to wrap all controls before I use it in my own projects. It would be usefuel if the wrapped control is still accessible from the outside world. I can define a property on the wrapper and hand out the instance of the wrapped 3rd party control.
public class MyCustomButton
{
private 3rdParty.Controls.Button _button;
public 3rdParty.Controls.Button WrappedButton
{
get
{
return _button;
}
}
}
This way one is able to access programmatically. But if one changes something in the visual designer, the changes made on the wrapped control are lost, because they aren't written down by the designer into the IntitalizeComponents() method.
Is there any way to tell the designer to store the init settings for the wrapped control as well?
Thanks
myMsg.BehindDaKeys = "Jerry Maguire";
-- modified at 13:05 Thursday 19th January, 2006
|
|
|
|
|
I'm have to get (image)files at runtime in your slideshow viewer, so they can be displayed in the viewer.
The photos are first being displayed with a string that tells you were the file is located. When I push on the Add-button, the photo must be shown in the viewer.
Does anyone knows how to do that, it would be really helpfull...
thx
|
|
|
|
|
Hello guys,
I am having here some problems regarding pc's where the RPC server is not running or pc's where the windows firewall is causing my program to crash.
I am doing some inventories with WMI queries. Most of them it is not a problem, but there are PC's were the windows firewall is on and giving me the following error (from the log file):
DISCOVERY Error, sComputerType, System.Runtime.InteropServices.COMException: De RPC-server is niet beschikbaar. (Exception from HRESULT: 0x800706BA)
After 4 of this errors my program quits, altought that I am using Try Catch.
Is there a way to check if the 'RPC server is available' prior to the inventory process?
Thanks in advance.
The code for your info:
<br />
public static string GetInfoWithWMI(string _sComputerName, string _sParameter, string _sObjName, string _sObjQuery)<br />
{<br />
string sComputerName = _sComputerName;<br />
string sParameter = _sParameter;<br />
string sObjName = _sObjName;<br />
string sObjQuery = _sObjQuery;<br />
string sValue = "";<br />
<br />
try<br />
{<br />
ManagementScope scope = new ManagementScope("\\\\" + sComputerName + "\\root\\CIMV2");<br />
scope.Connect();<br />
ObjectQuery query = new ObjectQuery(sObjQuery);<br />
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);<br />
<br />
foreach (ManagementObject queryObj in searcher.Get())<br />
{<br />
if (queryObj[sObjName] != null)<br />
sValue = queryObj[sObjName].ToString();<br />
}<br />
if (Program._LoggingEnabled == "Y" && Program._LogDiscoveryProcess == "Y")<br />
Program.LogInfo("Discovery process: object=" + sComputerName + ", " + sParameter + "=" + sValue, 1);<br />
return sValue;<br />
}<br />
catch (System.Management.ManagementException mex)<br />
{<br />
<br />
if (Program._LoggingEnabled == "Y" && (Program._LogDiscoveryProcess == "Y" || Program._LogProgramErrors == "Y"))<br />
Program.LogInfo("DISCOVERY Error, " + sParameter + ", System.Management.ManagementException: " + mex.Message, 3);<br />
}<br />
catch (System.Runtime.InteropServices.COMException comex)<br />
{<br />
if (Program._LoggingEnabled == "Y" && (Program._LogDiscoveryProcess == "Y" || Program._LogProgramErrors == "Y"))<br />
Program.LogInfo("DISCOVERY Error, " + sParameter + ", System.Runtime.InteropServices.COMException: " + comex.Message, 3);<br />
}<br />
catch (System.Exception ex)<br />
{<br />
if (Program._LoggingEnabled == "Y" && (Program._LogDiscoveryProcess == "Y" || Program._LogProgramErrors == "Y"))<br />
Program.LogInfo("DISCOVERY Error, " + sParameter + ", System.Exception: " + ex.Message, 3);<br />
}<br />
<br />
return "";<br />
}<br />
|
|
|
|
|
Found a piece of code that should do the job.
<br />
System.ServiceProcess.ServiceController myController = new System.ServiceProcess.ServiceController("Remote Procedure Call (RPC)", sComputerName);<br />
if (myController.Status == ServiceControllerStatus.Running)<br />
sRPC = true;<br />
else<br />
sRPC = false;<br />
Feedback me if you think that is wrong.
|
|
|
|
|
Hello all!
I'm a rookie at C# and i'm wondering why the hell does a new class library project with one function added by me generates a DLL with no functions???
I'm I being very dumb here???
The project only have two classes: AssenblyInfo.cs and Class1.cs
Class1.cs defines a class with one function.
all compiles well but no functions on the DLL!!!!!!
Help!!!!
|
|
|
|
|
What does the Class1.cs look like and how do you know it has no functions?
If you have something like below, "Main" is to be called on Class1 .. eg, Class1.Main(...) .
public class Class1<br />
{<br />
public static void Main(string[] args)<br />
{<br />
}<br />
}
- Malhar
|
|
|
|
|
Hello!!! Thanks for answering.
When I create a new Class Library C# project it comes with 2 classes: AssemblyInfo.cs and Class1.cs
I have only added GetInt() to Class1.
I know that the DLL exports nothing by opening it and I can see that it has no exported functions.
This is what I have:
namespace MyProject
{
public class Class1
{
public Class1{}
public int GetInt(){return 100;}
}
}
|
|
|
|
|
uNsignedINT wrote: with 2 classes: AssemblyInfo.cs and Class1.cs
AssemblyInfo is not a class.
uNsignedINT wrote: DLL exports nothing by opening it and I can see that it has no exported functions
How do you open it?
In order for you to access GetInt() method, you must first create an object of type Class1.
E.g.
Class1 myObject = new Class1();<br />
myObject.GetInt();
|
|
|
|
|
Yes your right I meant 2 files
AssemblyInfo.cs and Class1.cs
I open the DLL with the Dependency Walker just by double cliking on the DLL.
It shows me all the dependant dll's and the the functions that exports.
How would you do a DLL in C# that is supposed to be used by another application?
Thanks!
|
|
|
|
|
Hello All!
Somenthing must have go wrong with my project.
I've created a new one with more functions and all was good.
I really can't tell what was the problem but now everything is ok.
thanks a lot for your help and patience!
Cumps!
|
|
|
|
|
uNsignedINT wrote: How would you do a DLL in C# that is supposed to be used by another application?
Expose the classes and methods to COM in your C# project. By default, this doesn't happen, and is why you can't see anything in Dependancy Walker.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how do i convert a string to a rich text format
thx
Nana
|
|
|
|
|
Easiest way of achieving this is:
Create an object of type RichTextBox
Set the Text to your non-RTF text to your RTFtextbox.
Get the RTF text by using the RTF property of the textbox.
- Malhar
|
|
|
|
|
This is a quick-and-dirty solution.
You should use some "manual" conversion.
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
Agree .. but it is guaranteed to work! Fast, simple, safe! Cant ask for anything more
To avoid performance issues, create and use a static object of type RichTextBox so you are not unncessearily create this object everytime.
- Malhar
|
|
|
|
|
You should use a manual approach if performance is important and the text is simple (limited formatting). If low maintenance or high reliability is important, use the RichTextBox. There is no point in writing code already provided by Windows - you will simply have more code to introduce bugs into.
|
|
|
|
|
Hi i have a Windows Application!!
In which i need to Display the Time of Two Countries,
For example:
When the application is Loaded, i want to Display the "Local Time/System Time" and "GMT time" and "Eastern Standard Time" on the window!!
In .NET there is option only for getting the current time zone!!("System.TimeZone.CurrentTimeZone");
!
Any helps or any sample codes or suggestion !! Please!
Thanks in advance!
One Shot dont miss you chance to go!!!!
|
|
|
|
|
|
You can do this by using the interop layer to call Win32 functions. The function GetLocalTime will give you the local system time. Calling GetSystemTime will give you the current GMT time. You then can use SystemTimeToTzSpecificLocalTime to convert GMT to Eastern Standard Time.
Andy
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
i want to create a DataSet with 2 Tables, and i would to popolate these tables with this selection string:
Select * FROM TableInfo Where User = "Sasuko"; Select DISTINCT Number FROM TableInfo;
but it is not supported in Microsoft Access? How can i do it?
Futhermore if i have a table like this
|Name|Number|
Sasuko 09
Nichol 07
Joy 07
Michael 09
Simon 09
i want as result 2 becouse 09 and 07 are the only two number inside the table; Select DISTINCT Number FROM TableInfo; return me two rows with 09 and 07. if i do Select Count('DISTINCT Number') FROM TableInfo; i get 5 that is the number of all the rows
|
|
|
|
|
This is not the correct forum.
Use the SQL / ADO / ADO.NET messageboard.
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
Jet/Access doesn't support multiple statements in a query, otherwise known at a batch in the SQL world. Only single statements are allowed. You'll have to break this up into two seperate queries and run them seperately.
I think your second query should look like this:
SELECT COUNT(DISTINCT Number) FROM TableInfo
No quotes around the DISTINCT Number part.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|