|
nope i dont want them to be identical.. i just want to keep the existing values of the old xml, and include if there are any new values in the new xml.
im deaf to the word no
|
|
|
|
|
How do I search for the presence of an item in a data queue using queue.cs and form1.cs ?
Thanks
|
|
|
|
|
Hi,
I have a list of string array's (of size 4) that I need to sort...
I need to sort in the following order based on these conditions:
NOTE: I have a bunch of values that I am comparing to values in the string array's, these values are what i'm referring to when I state "matches"
if array[0] and array[1] matches
if array[1] matches and array[2] matches
if array[1] matches and array[3] matches
if array[1] matches
if array[2] matches
if array[3] matches
any other results.
Can anyone suggest a way that I can do this efficiently? I see there is a list.Sort() method, but I'm not sure if this can do what I want to achieve.
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
The Sort method works just fine, but you need to write a comparison method to use with it.
public int CompareArrays(string[] x, string[] y) {
return string.Compare(x[0], y[0]);
}
Usage:
myListOfStringArrays.Sort(CompareArrays);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thankyou very much Guffa~!!
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Here, it is source code
public DataTable SearchField(string strSearch, string strFieldName)
{
DataTable dt = new DataTable();
foreach (DataRow dr in data.Rows)
{
string strT = dr[strFieldName].ToString();
if (stringSearchMP(strSearch, strT) != -1)
{
DataRow row = dr;
dt.ImportRow(row);
}
}
return dt;
}
I don't know to cause why my function return null. Because, DataGridView.DataSource = dt can't show data. Anyone help me? Anyway, thanks so much!!!
|
|
|
|
|
What actually do u want to do?
can u explain in detail.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
I think of my explain very clearly for you. anyway, thank you so much. I get it and i get answer, have a good day!
|
|
|
|
|
maybe you need ot clone the table structure from source datatable,like 'dt=data.Clone()',then import rows.
|
|
|
|
|
|
I think you mistake and omit line dt = data.Clone() before foreach(DataRow dr in data.Rows)
|
|
|
|
|
Hi everyone,
i am a little bit desperate already I am trying check input pin of RS232 9-pins port. I can check only three of them - CTS, DSR, DCD, but i cannot check if on RI(Ring Tone, pin 9) is logical 1 or 0. i am using something like this(System.IO.Ports; reference):
SerialPort port = new SerialPort(/*settings of port is here*/);
port.Open();
if(port.CtsHolding == true){
//some code here;
}
if(port.CDHolding == true){
//some code here;
}
if(port.DsrHolding == true){
//some code here;
}
port.Close();
I want to add something like this:
if(port.RIHolding == true){
//some code here;
}
but it is not working. I didnt find any article about this even on MSDN forum, so i do not now how i can check this pin(RI) if there is signal or not.
Can somebody help me with this please?
Tank you
modified on Friday, September 5, 2008 6:28 PM
|
|
|
|
|
how can i integrate the following code into searchable combobox using the AutoComplete, i mean just like a textbox which will pick from the combo list? but must only select so it should not allow to type new values and it should also have ValueMember as well as Displaymember?
http://www.codeproject.com/KB/winsdk/Win32AutoCompleteComboBox/Win32_SDK_C_AutoCompleteComboBox1.gif[^]
here is the code I am currentlly usinga and want to integrate into AutoComplete:
private void get_vehicle_branches()
{
try
{
sql_connection = new SqlConnection("Data Source=.\\SQLEXPRESS;initial catalog=rent_a_car_company;integrated security=true;");
sql_connection.Open();
sql_command = new SqlCommand("sp_get_vehicle_branches", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_adapter = new SqlDataAdapter();
sql_adapter.SelectCommand = sql_command;
data_set = new DataSet();
sql_adapter.Fill(data_set, "vehicle_branches");
cboVehicleBranch.DisplayMember = "branch_name";
cboVehicleBranch.ValueMember = "branch_id";
cboVehicleBranch.DataSource = data_set.Tables["vehicle_branches"].DefaultView;
cboVehicleBranch.SelectedIndex = -1;
}
finally
{
if (sql_reader != null) sql_reader.Close();
}
}
|
|
|
|
|
How about contacting the author of the article you linked the image from?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
too Smart!! but I am asking for ideas as well..
|
|
|
|
|
jrahma wrote: asking for ideas as well..
What kind of ideas are you thinking of?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
what's the best way to do it?
how can i use the autocomplete with the ValueMember?
How to avoid adding new values and stick to the DisplayMember values?
|
|
|
|
|
Hello all, I'm having some trouble with richTextBox. Using c# in Visual Studio 05.
What I do first is to copy the control code ({\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard)
in a string, and then the text I need from an rtf file (\f0This is some {\b bold} text.\par) in another string and combine them, I do this for loading specific lines of the file...
Anyway, the problem is that when I load this in a richTextBox (rtb.Rtf = myString;), I noticed that the control code is changed. For example if the control code cotains code for 5 fontsyles in its fontable
({\f0\fnil\fcharset161 Microsoft Sans Serif;}{\f1\fnil\fcharset0 Tahoma;}{\f2\fnil\fcharset0 Arial;}{\f3\fnil\fcharset0 Arial Black;}{\f4\fnil\fcharset0 Arial Narrow;}),
if the text uses only 3 of them the rest two are not included in the control code of the richTextBox
({\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Arial Black;}{\f2\fnil\fcharset0 Arial Narrow;}).
I hope you understand what my problem is.
Is there a way of avoiding this to happen, or, if not, how can I control this so when I need to make some changes in the fontstyle of the text, the file will be updated with no mistakes (like f1 is "Tahoma" and not "Arial Black")?
|
|
|
|
|
Hi All,
Im very new in this and im trying to use a datagridview to show some data from sql server.
The user can select multiple rows in the datagridview and ofter pressing the 'del key' and clicking on the 'Save'button, the selected rows will be removed.
The problem is that the last row always remains and can't be remove.
Here some code of how im trying to update the datatable :
myconn = new SqlConnection(ConnectionString);
SqlCommandBuilder cb_imp = new SqlCommandBuilder(myda);
myconn.Open();
myda.Update(mydt);
Can anyone tell me how to fix this?
Thanx.
|
|
|
|
|
Have you selected the property "AllowUserToAddRow" of the datagridview to false?
|
|
|
|
|
|
On msdn it says about listview that, "In virtual mode, only the items required are created".
My questions is that who decides how many items are supposed to be displayed, is that the size of the listview. If so, then let's say if is set listview1.VirtualListSize=1000; and the listview size is listview1.Size=new Size(10,10); does it mean it loads only 1 ,2 ,3 or may be 4 items and the rest aren't loaded in memory.
Seondly, the image loaded sucessfully but it is blurred. it's not cleard at all
void listView1_DrawItem(object sender, DrawListViewItemEventArgs e)
{
Bitmap b = new Bitmap(120,60);
PictureBox p = new PictureBox();
p.SizeMode = PictureBoxSizeMode.StretchImage;
p.Image = Resource1.WinterImage;
p.DrawToBitmap(b,new Rectangle(0,0,120,60));
e.Graphics.DrawImage(b, e.Bounds);
}
If i add picturebox on a form loaded event like this, it's very clear
private void Form3_Load(object sender, EventArgs e)
{
PictureBox p = new PictureBox();
p.SizeMode = PictureBoxSizeMode.StretchImage;
p.Image = Resource1.WinterImage;
p.Location = new Point(300, 300);
Controls.Add(p);
}
|
|
|
|
|
AFAIK the ListView controls how many items it will request using RetrieveVirtualItem event. VirtualListSize defines the amount of items that can be retrieved (size of the actual data collection). This way the scroll bar scrolls as exopected.
Image blurring may be a result of scaling a bitmap. Since it's not vector-based, the result isn't clean.
|
|
|
|
|
Using a picture box in that manner may cause problems: it doesn't belong to any form, it doesn't have any specific size...
Why don't you just draw the "WinterImage" directly to the Bitmap? There's no need for a picture box.
|
|
|
|
|
Hi,
I am running visual studio 2008 under xp x64
All of a sudden the VS stopped working and can not see the toolbox controls...
So I tried re-install/repair/Uninstall. None of these work now and I get this error in the error log:
Any thoughts please? thanks
***EndOfSession***[07/10/08,07:40:50] Microsoft Document Explorer 2008: [2] Error: Installation failed for component Microsoft Document Explorer 2008. MSI returned error code 1603
[07/10/08,07:42:35] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:42:34: CA_ExportTempHxDs.3643236F_FC70_11D3_A536_0090278A1BB8. Return value 3.See MSI log for details.
[07/10/08,07:42:35] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:42:35: INSTALL. Return value 3.See MSI log for details.
[07/10/08,07:42:42] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147023293.
[07/10/08,07:43:27] Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime): [2] Error: Installation failed for component Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime). MSI returned error code 1603
[07/10/08,07:45:26] Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1638
***EndOfSession***[07/10/08,07:40:50] Microsoft Document Explorer 2008: [2] Error: Installation failed for component Microsoft Document Explorer 2008. MSI returned error code 1603
[07/10/08,07:42:35] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:42:34: CA_ExportTempHxDs.3643236F_FC70_11D3_A536_0090278A1BB8. Return value 3.See MSI log for details.
[07/10/08,07:42:35] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:42:35: INSTALL. Return value 3.See MSI log for details.
[07/10/08,07:42:42] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147023293.
[07/10/08,07:43:27] Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime): [2] Error: Installation failed for component Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime). MSI returned error code 1603
[07/10/08,07:45:26] Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1638
[07/10/08,07:45:44] VS70pgui: [2] DepCheck indicates Microsoft Document Explorer 2008 is not installed.
[07/10/08,07:45:45] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2008 Professional Edition - ENU is not installed.
[07/10/08,07:45:45] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime) is not installed.
[07/10/08,07:45:45] VS70pgui: [2] DepCheck indicates Microsoft SQL Publishing Wizard is not installed.
[07/10/08,07:49:18] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:49:18: CA_ExportTempHxDs.3643236F_FC70_11D3_A536_0090278A1BB8. Return value 3.See MSI log for details.
[07/10/08,07:49:18] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:49:18: INSTALL. Return value 3.See MSI log for details.
[07/10/08,07:49:20] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147023293.
[07/10/08,07:49:26] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2008 Professional Edition - ENU is not installed.
[07/10/08,07:57:20] Microsoft Document Explorer 2008: [2] Error: Installation failed for component Microsoft Document Explorer 2008. MSI returned error code 1603
[07/10/08,07:57:50] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:57:50: CA_ExportTempHxDs.3643236F_FC70_11D3_A536_0090278A1BB8. Return value 3.See MSI log for details.
[07/10/08,07:57:51] Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ACTION FAILURE:Action ended 07:57:51: INSTALL. Return value 3.See MSI log for details.
[07/10/08,07:57:58] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147023293.
[07/10/08,07:58:18] Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime): [2] Error: Installation failed for component Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime). MSI returned error code 1603
[07/10/08,07:59:24] Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1638
***EndOfSession***
|
|
|
|
|