|
Well I meant it doesn't fit with the switch .
This is a case where a series of if/else s is better than a switch
if ( ( c < ' ' ) || ( c > '~' ) ) // append ' '
else if ( c == '\"' ) // append '\''
else // append c
The original VB (?) is more complex than necessary.
|
|
|
|
|
Thanks for your help Luc!
stone_sks
|
|
|
|
|
You're welcome.
|
|
|
|
|
Thank you for you help . I'll experiment with
all the suggestions.
stone_sks
|
|
|
|
|
Yes, it could be that simple.
What I am doing is parsing through a SQL string
of text where I need to check each character's ASCII
value. The string I am checking will be form of an
SQL statement. My end goal of the program I am
developing is to convert the statment to Vb style
SQL.
But yes, it could be as simple as
your example inside a for loop. Thank you.
stone_sks
|
|
|
|
|
You seldom need the integer ASCII value of a character in a C# app !
You can use character constants such as '=' and even '\"'
If you really want to know their integer value try
char c='=';
int ASCIIvalue=(int)c;
|
|
|
|
|
Hello everyone,
Here is a scenario:
Front End:
MSVS2005 - C# - DGV
Back End:
MS SQL Server2005 - Stored Procedures
On the backend the main table contains a column named "OfficeID", tinyint, and in another table named "Offices" there are three coulmns "OfficeID", tinyint (PK); "OfficeName", nchar; and "OfficeAbb", nchar.
In my SELECT stored procedure I do an INNER JOIN of "OfficeID" columns in these two tables and display the OfficeAbb string on my front end DataGridView when I call the SELECT stored procedure instead of that tinyint stored in the main table.
This works great and DGV displays the Office Abbreviation based on the tinyint stored in the OfficeID column of the main table.
However, when I try to call my UPDATE stored procedure to update the main table I get "Failed to convert parameter value from a String to a Byte" because the DataSet now holds that two letter string office abbreviation and apparently the DataAdapter is not smart enough to lookup the Offices table and replace the string with the OfficeID tinyint for me.
I guess I either have to use some method of the DataAdapter to instruct it to translate the string into the tinyint based on the Office table values or to change the UPDATE stored procedure to where it would accept the string and than do the value translation for me. I suspect both options are possible but was unable to Google this out despite this being such a common scenario.
Any help is appreciated.
Thanks for reading,
Dean
|
|
|
|
|
I have been asked to develop an executable that will be called by a VBscript located on a fileserver (the executable will be located there too). The application needs to check to see if a file exists in a folder. If it does then it needs to read the file to see if a particular line exists and change it. Since the script runs under the user's login and the file is in their C:\Windows directory (they don't have rights to edit anything in this folder) the executable will need to run as Domain Admin in order to edit the file. I am sure I can determine if the file exists and read it, but I am not sure about how to editi it using different credentials. Could I get some pointers as to how to go about doing this?
Thanks,
Mike Donner
Email me at mike_donner@saaerospace.com
|
|
|
|
|
hello frnds
i have designed a window form usin graphics in c#.
now i want to save it as my screensaver
please help me and suggest me wat to do and how
thanks
|
|
|
|
|
IIRC a screen saver is no more than an EXE file that got renamed to an .SCR extension;
after that you can (with or without copying it to a more appropriate folder)
select it thru the Display Properties' ScreenSaver tab.
|
|
|
|
|
|
hi
i want to know how to determine that .NetFrameWork has been installed on the target system or not (via registry keys or ....) ?
and also i want to detrimine version of frameWork that installed on the system. thanks
|
|
|
|
|
As a C# question: write any C# program, if it runs, there is at least one
.NET available; if you get a weird error message, the .NET version you built
against is not available.
Search CodeProject for "Framework version" and you will find some good articles[^].
|
|
|
|
|
Hi!
Several approaches look at the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP has a subkey for each installed version of the framework, along with further information (for example if a service pack is installed or not).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
A bit late but as another suggestion you could look at the file mscoree.dll in your system32 directory. This files version indicates the version installed on your machine.
|
|
|
|
|
Hi,
This is a splitoff from my previous thread, but since this one is pretty narrow, I decided to give it separate thread... hope that this is ok with admins.
Anyhow... I have a .DLL i compiled, and added as a reference to a C++ project in .NET. Now I need to be able to access its members somehow. Both library and its namespace are called HyTest, however HyTest:: or HyTest. yeild nothing. Is there a specific way to access members of a DLL (written in C#) compiled in .NET?
wbr,
Victor
|
|
|
|
|
Hi Victor,
Whether you refer to a VB.NET, a C#.NET or a managed C++ DLL makes no difference;
from the outside you almost cant tell what language was used to build the DLL !
So treat it as if it were some other managed C++ DLL.
|
|
|
|
|
Well the thing is I don't know how to treat a DLL =)
How exactly do I access classes inside of it?
|
|
|
|
|
I dont know for C++, but this is how it works in C#:
assuming you have added to your project a reference to the new DLL,
you can access the types (classes, structs, enums) in the new DLL exactly
as if they were in your own exe, i.e. you use the class name if it resides in the same
namespace, and namespace.classname otherwise.
|
|
|
|
|
C++ seems to handle it differently.
I cannot use the public classes from included library, or include the DLL into given local class for that matter.
|
|
|
|
|
Hi,
I now have a managed C++ project that calls upon a C# dll.
It works as expected.
If your C++ is managed code, it is as I said before.
If your C++ is unmanaged, you will need P/Invoke.
|
|
|
|
|
unless you're using C++.net (don't recall the official name) you can only access .net code in c++ as a COM object.
PS this would probably be better posted in the C++ forum.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hi,
When I compile my project and it automatically creates a .dll file in my websites bin directory. plus it creates relating .pdb file. Why does it do this? I don't want that file there, and any other file, just the .dll file. Am I correct or incorrect in saying this? How can I do this?
Regards
ma se
|
|
|
|
|
The pdb contains the debug symbols for your code. It's used to help during debugging so if I was you I'd leave it where it is :P
If you want to build a version for general release you need to change the ComboBox next to the Green arrow (the build button) from debug to release.
|
|
|
|
|
The pdb file stores the debugging information. When you build the software in debug mode you get the pdb file, if you use the release mode you just get the dll. The other files your talking about may be dependent dll's or configuration file, etc.
|
|
|
|