|
Mix Wheels wrote: uploadedImage.SaveAs(strImagePath); //error "Object reference not set to an instance of an object."
how many references are there in this line? I see 1.
hence uploadedImage is null. fix that.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hello all,
How can I allow a user to type a letter on the keyboard and have a DataGridView (DGV) change current row to the first occurrence of the letter within a non-Primary Key column.
For example, LastName is a column in a DGV. Typing ‘S’ should change the current row of the DGV to the first Lastname that starts with an ‘S’. Note: LastName is not the primary key of the bound table.
I am using a DataGridView bound to a DataSet.Table[] without a binding source.
Here is a code snippet I tried, but it returns -1:
ds.Tables["Students"].DefaultView.Sort = "LastName";
int intRow = ds.Tables["Students"].DefaultView.Find("S%");
I have also tried this, but it returns zero rows:
ds.Tables["Students"].DefaultView.Sort = "LastName";
DataRowView[] drv = ds.Tables["Students"].DefaultView.FindRows("LastName LIKE 'S'");
Thanks in advance,
KCI
Live long and prosper.
|
|
|
|
|
Isn't the last one missing a wildcard?
JimSchor wrote: ds.Tables["Students"].DefaultView.Sort = "LastName";
DataRowView[] drv = ds.Tables["Students"].DefaultView.FindRows("LastName LIKE 'S*'");
I are Troll
|
|
|
|
|
Hello Troll,
Thanks for the advice.
I just tried it and no difference.
Any more thought anyone?
KCI
Live long and prosper.
|
|
|
|
|
Here is how I eventuall worked this out. I have not tested it deeply so take this only as an outline:
using System.Collections.Generic;
private string strKeyPreview = String.Empty
private List<string> strStudent_List = null;
private void dgv_KeyPress(object sender, KeyPressEventArgs e)
{
strKeyPreview = e.KeyChar.ToString();
int intRow = strStudent_List.FindIndex(StartsWithLetter);
if (intRow >= 0)
{
dgv[3, intRow].Selected = true;
dgv.FirstDisplayedScrollingRowIndex = intRow;
}
}
private bool StartsWithLetter(String s)
{
if (s.StartsWith(strKeyPreview.ToUpper()) == true)
{
return true;
}
else
{
return false;
}
}
strStudent_List = new List<string>();
foreach (DataRow dr in dt.Rows)
{
strStudent_List.Add(dr[2].ToString());
}
Feel free to post improvement ... I'm sure this is not bullet proof as it is untested.
Live long and prosper.
|
|
|
|
|
i have a treeView in splitterContainer, the treeview flickers when i try to resize the Form using mouse at any of the corner screen edges. the flickering will not happen if i try to increase the Forms Width, or the Lenght. it flickers only when i increase size of the Form at the corner edges. Can you help me with this i am using VS 2005.
|
|
|
|
|
Hi
I wish to remove installed program from control panel using C# . Can anyone suggest me something how to proceed?
|
|
|
|
|
To remove application from control panel, just go to C:\WINDOWS\system32 and rename the file with ".CPL" extension.
Just write a code to do that.
|
|
|
|
|
Ajithevn wrote: an anyone suggest me something how to proceed?
Yes. Try to reformulate your question.
* Do you want to remove an applet from the control panel (e.g., removing the "Mouse" icon from the folder "Configuration"), OR
* Do you want to uninstall an application (e.g., uninstall FireFox), OR
* Do you want to remove an entry in the list of installed applications (e.g., when an app is deinstalled, but still listed in the 'installed applications')
I are Troll
|
|
|
|
|
yes i want to uninstall an application. i.e i have created a setup of my application and intalled it and i want to uninstall that application from another c# application.
|
|
|
|
|
Take a look at the registry, under the key
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ie8 It contains a key called UninstallString , with the value "C:\Windows\ie8\spuninst\spuninst.exe". If you execute that application, it will uninstall IE8. The key also contains the name of the app (e.g., "Windows Internet Explorer 8") and the InstallDate (e.g., 20090806). You'll also find service-packs and the likes if you browse further. Alternatively, you can search the registry for the key "uninst.exe".
Not every application will have such an entry. DOS-applications are usually copied, and thus don't register an uninstaller for the app. Also keep in mind that the current user might not have the privileges to uninstall applications.
Happy Programming
I are Troll
|
|
|
|
|
Got the bugger!
It seems that 2 things aren't happening and I can't tell if this is going to be the case every time. It took a bit of doctoring and manual splicing of the the .sln file and the .csproj files. Seems like the configuration manager is not creating the new build configurations inside the .csproj files
Solution:
1. .csproj files, add the build configuration from another file that already has a successful one
2. .sln file (this is bit complicated, backup before you get too ballsy)
i) find the name of the project(s) that is giving you hell, at the far right of that defining line, you'll find a GUID, this is the project GUID that is referenced later, you'll also need to copy the GUID for a working project under the configuration that you want to fix
ii) scroll down and find in the section titled "GlobalSection(ProjectConfigurationPlatforms) = postSolution" an entry for the working project (by GUID) (e.g. {72C74E6F-8D11-4324-A412-1905FFEACD5E}.Radiology|Any CPU.ActiveCfg = Release|Any CPU) Note, you will find that projects left loaded when this configuration is chosen will have two entries, whilst the unloaded ones have only a single line entry
ii)copy this entry and then find the list of entries for the project that's giving you hell (by GUID), insert it into this list by pasting it (you'll see that it does not have a list item); Be sure to replace the GUID in the pasted item to that of the project that's giving you issues.
3.Save the files
4. Fire up VS or if its already open, if asked to reload the solution/projects, accept. If they were unloaded, reload the projects that you manually amended.
5. Build with the projects once
6. Unload the projects you wanted (the ones you just manually spliced)
7. Build again to check.
8. Happy coding (or as much as possible)
If done right, it should work.
The current Solution I'm working on has 19 projects at the moment and there are another 4 on the way. Because of the size of the solution and because build times are beyond annoying and for to simplify traces and a plethora of other reasons, projects that are not involved directly in the current cycle of development and testing are unloaded. This worked like a charm until yesterday evening when a new project was added, along with its own configuration (there are 9 configurations at the moment, I added another 2 last night and eventually there will be 15).
I get this error message when I build:
Error 1 The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Radiology' Platform='AnyCPU' AppChooser
Now, I've figured out the reason is because I've unloaded the two project being referenced. Reloading them (which brings me back to the complete list of projects) makes the build go perfectly fine.
Googling has shown that others have faced similar problems, I just couldn't find any solutions or workarounds.
Suggestions?
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
modified on Thursday, October 1, 2009 9:38 AM
|
|
|
|
|
|
Thanks Vasudevan, I didn't see your post because I was mucking about with the .csproj and .sln files.
Got it to work
If you'd like to know how, check the OP.
Thanks a zillion though, the method in the link seems a simpler way of doing it.
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
Hi Mustafa!
I've only a little build experience and not a lot in more unusual setups (such as the need to build certain projects), so apologies if I've misunderstood your question.
Rather than unloading unneeded projects, is setting them not to build under the particular configuration an option? You can build all the projects once per config, then disable the ones you aren't going to work on and use the one. This will utlimately speed up your build times for the configs, but you'll have to take the hit of the initial full build.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Cheers mate!
keefb wrote: Rather than unloading unneeded projects, is setting them not to build under the particular configuration an option?
It depends on the size of your projects mate, some of mine are massive (on par with my body weight actually!)
keefb wrote: You can build all the projects once per config, then disable the ones you aren't going to work on and use the one. This will utlimately speed up your build times for the configs, but you'll have to take the hit of the initial full build.
Another thing that I've done is that I've altered the output path of all the built binaries to a generic "bin" folder. This way, I don't 19 copies of a particular dll, with the only difference being the build configuration (binary wise, they'd be identical).
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
Hi all,
I have developed a VSTO add-in for MS Outlook 2007, which works perfectly within the 2007 version of Outlook, but the problem is that when I try and run it within the 2003 version of Outlook, it doesn't seem to work. Does anyone perhaps know of a site that can offer me with a solotion or perhaps know how I can overcome this issue?
Many thanks in advance.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: when I try and run it within the 2003 version of Outlook, it doesn't seem to work.
This is not very descriptive. What exactly happens with the 2003 version?
I would suggest you take a look on the MSDN site for further information about using the Outlook interfaces.
|
|
|
|
|
|
|
Microsoft don't support Form Regions against Outlook 2003
For more info see here[^] and here[^]
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
To solve issue buy and install the following Add-in-express[^]
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
Is there any framework or concepts in .Net to implement Feedback Mechanism from server end.
Let's say i'm running WCF services and client is registered with that, i want to send some feedback to clients if any changes happens on Server?
Or any patterns ?
|
|
|
|
|
|
I am trying to convert some powershell code that fetches info from a systems registry. The powershell code is capable of accessing true 64bit registry info when executed from a 32bit workstation. The similar code in C# when executed in the same fashion fails to work as the C# code gets redirected to the wow6432node of the 64bit registry.
Can someone explain why powershell (which I believe uses the same libraries that C# uses) does not get reflected/redirected to the wow6432node of the 64bit registry and why the C# code does?
Second I have done some reading is there a simple way to get C# to do the same thing as the powershell script? (e.g. no use of some C++ dll file or something that I read about).
As I am still green with C# any assistance would be greatly appreciated.
|
|
|
|