|
Sounds like homework, or an examn maybe? ^^
-Larantz-
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
It's not exaxtly homework,but i'll use it as small part in a big project...u can help me..
|
|
|
|
|
hi Al Friend
i Developing application by C#
i get All user in Domain by LDAP, i get user in Groups
But i dont know get Premission of that Groups
can some friend help me !
thanks
|
|
|
|
|
Dear friends,
Is it possible to bind the fields of structure to the controls on the form ?
For example.. i got a structure
struct Student
{
String firstName;
String lastName;
// and many other fields and properties
}
Now i got a *form* in which many text boxes are present related to the student. I am initializing form as follows;
txtBoxFirstName.text = student.firstName;
txtBoxLastName.text = student.lastName;
// and so on
Similarly when the form is dismissed, i read the changes back to the structure as:
student.firstName = txtBoxFirstName.text;
student.lastName = txtBoxLastName.text;
// and so on
Now, the problem is that the *Student* structure is very simple containing two fields, as such i need two text boxes on the form. But what if it contains 10 or 15 fields. As such i need to manually read each of the field value from the structure and displaying it in each of the edit controls. And then manually read changes from each edit control to the structure fields.
Is it possible to directly *bind* the strucute fields with the edit controls. It is very easy in ADO.NET. But i dont know whether it is possible in my case ?
Imtiaz
|
|
|
|
|
Can #define be used to define string constants as we do in C lang?
e.g. #define FIELD "Field"
the statement gives an error saying, "Single line comment or end of line expected"
Is this the limitation of the c# language ( no offences meant to c# gurus ) or is there any different systax to be used? Please help.
Thanking in advance.
-- modified at 2:28 Friday 26th May, 2006
|
|
|
|
|
abhijit pai wrote: Can #define be used to define string constants as we do in C lang?
No.
abhijit pai wrote: Is this the limitation of the c# language
It is not a weakness of the language - It is a strength of the language.
abhijit pai wrote: is there any different systax to be used?
Use a const to define values like this.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
It is not a weakness of the language - It is a strength of the language.
Since I* am a newbie to c# I do not undersatand how it is a strength.
Can you please kindly explain?
I will be very thankful to you.
|
|
|
|
|
Just use
const string myStr = "text";
-Larantz-
|
|
|
|
|
abhijit pai wrote: I do not undersatand how it is a strength.
Can you please kindly explain?
It is a strength because it forces you to use proper language constructs and to put strings and other values in to const s
For example in C++ you could put
#define MY_STRING "my_string"
SomeFunction(MY_STRING);
or worse
#define MY_INT 5+5
SomeFunction(MY_INT*MY_INT);
which expands out to SomeFunction(5+5*5+5); which is equivalent to SomeFunction(35); and not SomeFunction(100); which some might be expected.
in C# you put
const MY_STRING = "my_string"; or
const MY_INT = 5+5;
When you call SomeFunction(MY_INT*MY_INT) you get a value that makes sense.
using const s in C# is also type safe. So the compiler can show you easily what the problem is, if there is one. Preprocessor statements like #define are naturally evaluated before the compiler runs. This means that in C++ the defined values are expanded out in advance. If the compiler has a problem with some code it can only show you the expanded version, which may look quite different to the version you see in the IDE, since it never sees the version you see.
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
it does help alot, but I would be thankful to u if can please provide more clarity on it or some link that would make it undersand me in depth.
|
|
|
|
|
What is to understand, it is a not supported feature - Use const s.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi friends,
I want to develop file monitoring system where I want to track down the files created by perticular process. I tried using FileSystemWatcher class to monitor drives\directories. But when any event occurs FileSysteWatcher fails to give any information about that process that has created/changed/deleted that file. It would be nice if somebody can help how to achieve this using c#!! Or I have to use some win32 apis to get this done? if so does anybody know about these APIs?
Hiren Suchak
-- modified at 1:52 Friday 26th May, 2006
|
|
|
|
|
To get the active sqlserver names
|
|
|
|
|
when i open a file stream, is it possible to start reading a specific line other than reading from the beginning to end?
|
|
|
|
|
No. The library has no way of knowing what a line is without walking through them, a newline is just another character ( well, two, but it's just data, there's no index ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi
i want to collect many files and create password protected self-extract file. how to do that ?
thanks ?
|
|
|
|
|
i called stored procedure that has variable output like "@ss int output"
but i couldn't collect value of that variable in c# i use 'executenonguery'
shoud i use another thing!! i don't know if any one can help me i'll be glade..
|
|
|
|
|
|
You can set the Direction property of an SQL Parameter object to ParameterDirection.Output if you're requiring output.
command = new SqlCommand(...);
SqlParameter outputParam = new SqlParameter("@ss", 0);
outputParam.Direction = ParameterDirection.Output;
command.Parameters.Add(outputParam);
command.ExecuteNonQuery();
int returnValue = (int)outputParam.Value;
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
i fill 1 data table from database . i have 1 datagrid on the form that i fill it manually. can i add one of the columns of the data table to my datagrid?
thank you
|
|
|
|
|
Yes you can, add a new column to the datasource (DataTable??) which you are creating manually and fill data in that newly added column from datatable filled from database.
Saqib
|
|
|
|
|
I created a global hotkey (Alt + F) using the RegisterHotKey API and then in WndProc caught the WM_HOTKEY message and then started a keyboard hook which blocks all keys typed from reaching other applications. (The point of this was so I could press alt+f type in a command and press enter to execute whatever app or website that's associated with the command.) The hook is started using the SetWindowsHookEx API with a delagte pointing to a procedure that catches WM_KEYDOWN and WM_KEYUP message. (Based on the code found at http://www.codeproject.com/csharp/globalhook.asp[^])
My problem is that after stoping the hook the 'alt' key is still in it's keydown state (I'm guessing that the hook ate the keyup message instead of sending it back) so pressing keys on the keyboard will access the menu or whatever other hotkeys there are. I've tried sending a WM_KEYUP message (using SendMessage API) for the alt key after the hook was stopped, but it didn't work. I wasn't sure of what window handle to send it to for a hotkey or if it even matters (I used the main form of which the hotkey was registed with).
Thanks
Blake
|
|
|
|
|
Hi,
I am writing a multihread app in C# 2003. There is unmanaged dll in it.
When GC activates after memory reaches the some level of fullness,an exception is thrown. It is access violation exception from mscorwks.dll and application crashes.
If someone has an idea about it, it would be really helpful.
Best regards
asbasir
|
|
|
|
|
Hi,
I would like to find out how to append a bitmap to an existing bitmap in .net 2.0. I am programming in C++/CLI but C# code will also be fine.
What I am trying to accomplish is a 'Render to Disk' feature, where I can create a very large bitmap image on disk by appending a 'strip' at a time to the bottom of the image; thus growing the bitmap on the disk.
I have tried using the SaveAdd method, but have been unsucessful. Is this the right approach or am I barking up the wrong tree? Here is some code that I tried:
EncoderParameters^ params = gcnew EncoderParameters(1);
params->Param[0] = gcnew EncoderParameter(Encoder::ColorDepth, (short)32);
saveBitmap->Save(saveBitmapDialog->FileName, codec, params);
saveBitmap->SaveAdd(params);
The Save method works fine and results in a bitmap on disk, but SaveAdd fails. Any ideas would be greatly appreciated, there does not seem to be much info about this on the net.
Thanks!
zenzero
|
|
|
|