|
i don't understand u will but if u want to use pointer u can use it using unsafe code
|
|
|
|
|
I`m using System.IO.DriveInfo.GetDrives() funcd tion to get DriveInfo anextract information about drives but it works really bad with SATA disks (gives me errors)?
Does anybody have solution for this?
|
|
|
|
|
Vertyg0 wrote: but it works really bad with SATA disks (gives me errors)
What are the errors you get exactly? Also a code snippet would be very helpful.
Regards
|
|
|
|
|
DriveInfo[] drivesInfo = DriveInfo.GetDrives();
foreach (DriveInfo drive in drivesInfo)
listBox1.Items.Add(drive.Name + " " + drive.VolumeLabel);
************** Exception Text **************
System.IO.IOException: The device is not ready.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIODriveError(String driveName, Int32 errorCode)
at System.IO.DriveInfo.get_VolumeLabel()
at SqlServerMonitor.AddDisk.AddDisk_Load(Object sender, EventArgs e) in C:\...\AddDisk.cs:line 23
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
|
|
I would put the listBox1.Items.Add... in a try/catch , because you probably are asking your DVD-drive to tell you the VolumeLabel and if there is no DVD in it you will get an exception.
|
|
|
|
|
Hello Everyone
I was trying to write the algorithm that finds the anagram of words randomaly
for example hello
so far this is what i have
public void findAnagram(String prefix, String suffix)
{
String newPrefix, newSuffix;
if (suffix.Length == 1)
{
Console.WriteLine(prefix + suffix);
}
else
{
for (int i = 0; i < suffix.Length; i++)
{
newSuffix = suffix.Substring(1, suffix.Length);
newPrefix = prefix + suffix[0];
findAnagram(newPrefix, newSuffix);
suffix = newSuffix + suffix[0];
}
}
}
but for some reason it throws me a exception when i put it in main method
"Index and length must refer to a location within the string."
i am wondering if there is a better way to find a anagram of any word
thank you
|
|
|
|
|
homer simpsom wrote: suffix.Length
As you're starting at 1, and it's 0 indexed, the Length property goes one character past the end.
Christian Graus - C++ MVP
|
|
|
|
|
Hi Friends
I m using sqlhelper class file which is stored in DataAccessLayer,it is used for connecting the data from database.
But when i m using this sqlhelper in another class getting an error.
In visual studio 2003,the code is
SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Projectname.Global.CfgKeyConnString]
, "SPName", parameters);
but same code in 2005, getting an error.
so could any one give an idea to solve this problem.
Thanking U,
Naren.
|
|
|
|
|
Is it possible to serialize an Image?
I have a class that containes an Image loaded from a jpeg, when I tried to serialize it I couldn't.
any help would be appreciated
|
|
|
|
|
Hi
I would like to see the query log from sqlserver 2000, but i cannot. How can i do that?
|
|
|
|
|
hi
i want to set myDatagridView.Rows[i].Visible = false; but the Following error has shown me :
Row associated with the currency manager's position cannot be made invisible
How to solve problem and hide each Row that i select at runtime without this error ?
My Code is :
int i = 0;
while (i < this.dataGridView1.Rows.Count)
{
DataGridViewRow GridViewrow = this.dataGridView1.Rows[i];
if (GridViewrow.Cells[0].ToString() == "True")
{
}
else
GridViewrow.Visible = false; //error in this line
i++;
}
|
|
|
|
|
Well I'm not totally sure, but I can tell you're having a BindingSource problem.
In my expirience, I wouldn't be able to edit almost nothing usingn BingdingSource or TableAdapters, because we can not mess with the internal managment of the .NetFramework.
Solution: Fill the DataGridView manually using sql querry, it should solve the problem.. (I mean manually exactly how it sounds.. row by row and Cell by Cell)
good luck.
(sorry my english)
___________________________
vykom's best.
Free your mind! use GPL.
up to open source!!!
|
|
|
|
|
i cannot found any solution to "drawImage" my .wmf with smoothed lines.
Is there a way to do tha?
|
|
|
|
|
After taking a break from Microsoft IDE's and working in Java land, I'm missing the Control-LeftClick to click through a definition to navigate to the definition.
In Visual C# 2005 this just feels too clunky requiring a right-click and selection of a menu item.
I don't suppose anyone knows an option/plug-in that performs this?
Regards,
Ray
|
|
|
|
|
In my VS 2003 it's currently mapped to F12. But you can define an alternative key combination in Tools->Options->Keyboard and then slect Edit.GoToDefinition and type in a desired key combination. In VS 2005 it will be similar.
Kevin
|
|
|
|
|
That is also mapped to F12. You could change the mapping if you prefer.
|
|
|
|
|
I wrote a small win application. Is there a way to do a printprivew for whatever is displayed on a window form. I want to add print preview functionality for anything that appear on a form. Can you show me me some codes plz.
|
|
|
|
|
|
thank u so much am checking it
|
|
|
|
|
hi
i add an Unbound DataGridViewCheckBoxColumn to my datagridView for user to select each record that he wants to print (print with DataGridViewPrinter Class), I want to invisible other records that checkbox is False or null,
but at RunTime when i set a checkbox to true and uncheck it again (set to false)
when i want to invisible that record .. the following error shown me :
Row associated with the currency manager's position cannot be made invisible
my code is :
foreach (DataGridViewRow _gridViewRow in dataGridView1.Rows)
{
if (_gridViewRow.Cells[0].Value != null)
{
if (_gridViewRow.Cells[0].Value.ToString() == "True")
{
_gridViewRow.Visible = true;
}
else if (_gridViewRow.Cells[0].Value.ToString() == "False")
{
_gridViewRow.Cells[0].Value = null;
ds_zamin1.Khaneh_1.Rows.RemoveAt(_gridViewRow.Index);
}
}
else
{
_gridViewRow.DataGridView.EndEdit();
_gridViewRow.Visible = false; //Error Occured In this Line
}
}
|
|
|
|
|
You cannot make selected row/cell inviible.
Use...
dataGridView1.CurrentCell = null;
|
|
|
|
|
Try this.
CurrencyManager cm = CurrencyManager)BindingContext[this.DataGridView1.DataSource];
cm.SuspendBinding();
this.DataGridView1.Rows[index].Visible = false;
cm.ResumeBinding();
|
|
|
|
|
thx
|
|
|
|
|
In my c# desktop application i want to change key in my app.config file at runtime.
How can i change this value in runtime?
Actually my need is that i want to store a value somewhere during runtime which i can access next time the i run the program. So this need to be physically written.
Regrads
Hari
-- modified at 11:39 Thursday 23rd November, 2006
|
|
|
|
|
Settings are stored in the config file as properties -Xml elements-. You can access them using the following line
global::ProjectName.Properties.Settings.Default
The class Settings is inherited from global::System.Configuration.ApplicationSettingsBase . Check it in your MSDN or more simply explore it using intellisense.
Regards
|
|
|
|