|
|
jacklynn_mei wrote: using the sql dependency
Does this mean the nasty, autogenerated SQL ? I recommend writing your own, in stored procs.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
jacklynn_mei wrote: using the sql dependency
What is "SQL Dependency"?
|
|
|
|
|
I dont knwo what this 'SQL DEPENDENCY' really is? but I think your problem can be solved if u just write a simple SQL Query and well Query your Database and offcourse show the result or whatever!!
hope that helps
|
|
|
|
|
How i read Excel file by C# Program ? and how i put those datas into MS FlexGrid
-- modified at 6:01 Wednesday 15th August, 2007
|
|
|
|
|
shafikshafik wrote: MS FlexGrid
Why is everyone using the MS Flexgrid still ?
You need to download the Office toolkit from Microsoft, it will allow you to control Office from .NET. Of course, the code only works on PCs that have Office installed.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I add some objects of a user defined class,using Listbox.Items.Add().
And somehow change the value of one item object,don't the display supposed to be changed with that? I have tried update() and refresh(),but it did't work.
How to make the display change with the item object?
|
|
|
|
|
if you're changing the contents dynamically then you need to re-populate the list box by clearing the contents first and then adding them back again
hope it helps
|
|
|
|
|
Thanks for your help!I remove the item before changed,and add it to the listbox again,it works. But I thought it could be implemented by repaint or upate the listbox.
|
|
|
|
|
hi,
i need to pass following callback function to c++ from c#
(*func1)(double *p, double *hx, int m, int n, void *adata)
how do i define this function in c# and how do i pass it to c++?
Hope anyone can help me.
|
|
|
|
|
Hi,
you need to define a delegate, like so:
public delegate void func1(ref double p, ref double hx, int m, int n, IntPtr adata);
then pass an instance such as new DifoEventHandler(myFunc1) to the other party,
where myFunc1 is the method that has the appropriate signature.
If the void* is to be used in a managed environment you would have to
either adapt the definitions statically, or add code that handles it at run-time.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I want to check server connection at every transaction. how?
Syed Shahid Hussain
|
|
|
|
|
just use the server exception I'm forgetting its name at the moment.. but when u catch that one in the catch block. you'd know that the connection has been severed n then you can take appropriate action.
oh yes the name is SqlException (incase your using SQL Server).
use its message or tostring representation intelligently now!
|
|
|
|
|
Thanks friend.
Syed Shahid Hussain
|
|
|
|
|
if i have a text file with a whole lot of names in it, how do i bind that to check boxes on a simple form.
i would use a stream reader to get the data from the text file, could i then use a for each loop to run through the data within the text file and bind each check box to each line in the text file?
Thanks
Dan
|
|
|
|
|
I don't know what you mean by 'bind'. You're going to set your checkbox values based on what you find in the text file, but you won't 'bind' in the sense that you cannot make it so the file gets changed when you change the check value of a control.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok ye i hear you... but how do i make the check boxes display each line individually from the text file. so do i use a stream reader and for each line that is read, set the check box text to that which is in the text file?
|
|
|
|
|
The easiest way IMO is to use File.ReadAllLines to get a string array from the file. Then you can just iterate over that, and do whatever you like with it ( for example, setting the text of a control ). If your controls appear in order on your form, you could even iterate over the Controls collection of the form, and increment an index for your lookup string every time you find a check box.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I thought I'd get lucky with Google on this one, but unfortuantely didn't find anything. Or may be i was searching using the wrong keywords. (I'd put my bet on the latter)
Preamble:
I created a hello-world NT service in C# (nothing fancy here -- no WCF involved) and using installutil I'm able to deploy the service and then eventually using net start, I'm able to run the service as well. The service is running under "local system" account. The service has a timer, which ticks, say every 1 minute.
Question:
During the timer tick event handler, I'd like to find out a) if there is ANY user logged in at this time and b) if so, what is the name of the user who is using the machine?
I'm not interested to know which account is being used to run the NT service.
I tried System.Enviornment.UserName but that doesn't return what I need. It simply returns "user name of the person who started the current thread.".
(http://msdn2.microsoft.com/en-us/library/system.environment.username.aspx[^])
I hope to find a trivial solution to a trivial problem.
Thanks,
- Malhar
|
|
|
|
|
|
System.Diagnostics.Process should do what you need with regards to launching exe and passing in parameters. Unless you mean passing input to your own exe. In which case, use the args[] array parameter of the Main method.
A quick question for you : In which language do you specialise as a software engineer?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|
|
Hi
I have a dataset contains 37 columns and 4500 rows. For one of my business requirement, I'm reading the values into an string array and go for further processing.
Now, when it comes to next row, I want to make the array as new one as if no value should be there. It should be null? So any idea how to delete the array values? Is it correct if I make the string array = null?
Please advice. Many thanks
Meeram395
|
|
|
|
|
Hi, if you only want to make the array as new one, I think you can do that, either set the array to null or use "array = string.Empty", and the latter is better.
Thanks
|
|
|
|
|
Hello guys,
I'm trying to do a basic search depending on some pattern using wild cards when the shhhhhhtoopid System.IO.Directory.GetFiles function refuses to bypass an unaccessible folder..
Please help me
private void button1_Click(object sender, EventArgs e)
{
string[] arSourceFiles;
tryAgain:
try
{
arSourceFiles = System.IO.Directory.GetFiles(@"C:\", @"c*", System.IO.SearchOption.AllDirectories);
}
catch (Exception ex)
{
string[] fileName = ex.Message.Split('\'');
MessageBox.Show("error accessing file: " + fileName[1]);
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
process1.StartInfo.FileName = "CMD.exe";
process1.StartInfo.Arguments = @"/c attrib -h -s -r " + fileName[1];
process1.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process1.Start();
goto tryAgain;
}
backgroundWorker1.RunWorkerAsync();
}
-- modified at 2:31 Wednesday 15th August, 2007
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
What is the name of the unaccessible folder? There are certain folders in the root, and possibly elsewhere, that you simply don't have access to, unless you are some form of 'god' user. You are trying to set attributes on this folder in a catch? You've also caught a generic exception. Look to see what exceptions GetFiles will throw, catch and handle those specifically.
Key thing - which file / directory is giving you problems? What security context are you running under? What error do you get when you attempt to change the attributes?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|