|
I voted. I don't think he'll be happy, but I voted.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
True. He solicited a number near 'Rate this message'. And the most nearest number was '1'.
|
|
|
|
|
Click on one of the numbers beside 'Rate this message'.
Always happy to oblige
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Eduard Keilholz wrote: Click on one of the numbers beside 'Rate this message'
So the most nearest number and that which was specified in your request was granted, which is also the 'Univoter ' Fame: 'The Unique Number One '
|
|
|
|
|
I think you'll have to check the registry to see which application is registered by default to open the htm/html files and launch that one. Another option in to use PInvoke. I think the function needed is FindExecutable from shell32.dll. See www.pinvoke.net[^] for more info on that.
|
|
|
|
|
System.Diagnostics.Process.Start("about:home");
works for me. but then iexplore is my default browser so i'm not sure about other browsers but maybe you can test?
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Works in ie, no go in FF, that's the sort of thing I'm looking for though thanks!
I have no blog...
|
|
|
|
|
I have a database query that will, for purpose of discussion, return either 1, 2 or 3 results. It could be any of these sizes.
I also have an array with 3 values in it. This is fixed.
I want to loop from i = 0 to 2 and compare a field's value from query row i to the value in array row i and do something if they match and do something different if they don't.
However, since I will always be looping 3 times and sometimes my query result will only have 1 or 2 rows in it, how do I check to see if the query row index exists before I go forward with the comparison?
Something along the lines of IfExists(mydata.Rows[0]) == TRUE is what I'm looking for. Any ideas? Thanks in advance! -Kari
|
|
|
|
|
store 1,2 and 3 in ArrayList.
Arraylist has one method to check value is contains or not.
Arr.Contains(mydata.Rows[0]);
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
if you are using SqlDataReader then you can use
SqlDataReader datareader = dataCommand.ExecuteReader();
int i = 0;
while (datareader.Read())
{
if (datareader.GetByte(0) == array[i])
{
}
i++;
}
Becoming Programmer...
|
|
|
|
|
I'm programming in c#.
I' have a problem with database insert procedure. I need read the last record in a table because I need the last key and insert a new record with key + 1.
For this procedure I open connection, select the last key, insert the new key and close conncetion.
The problem message is: There is already an open DataReader associated with this Command which must be closed first.
How to make this insert without leave the database? I can problem with the concurrent coneections.
Thanks.
Diego
|
|
|
|
|
You should close your DataReader object before executing the code that performs your insert.
BTW, this doesn't look like the most efficient way of adding a new record. You should consider wrapping the whole operation in a stored procedure that selects the latest key to determine the new key value and then inserts the new record with this key.
Paul Marfleet
|
|
|
|
|
do you have an example of this operation? thanks
|
|
|
|
|
and you want to ensure you have sufficient locking on the table, for both the read and the write. If two people perform the same operation at the same time, they might both be given the same 'new' key.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hello,
I'm hoping someone can help me out here.
I want to get started using DataGridView, but I've not actually managed to find any examples that fit what I'm trying to do.
What I want to do is very simple:
(1) I have a list of class instances thus:
<br />
List<MyClass> classList = new List<MyClass>();<br />
<br />
classList.Add(new MyClass("Fred"));<br />
classList.Add(new MyClass("Wilma"));<br />
<br />
etc
(2) I want each MyClass member of classList to be represented as a row in my DataGridView
(3) I want to show only a subset of the class parameters, for example:
<br />
public class MyClass<br />
{<br />
private string name;<br />
private string desc;<br />
<br />
private int anumber;<br />
<br />
public String Name<br />
{<br />
get { return (name); }<br />
set { name = value; }<br />
}<br />
public String Description<br />
{<br />
get { return (desc); }<br />
set { desc = value; }<br />
}<br />
<br />
<br />
<br />
public int Number<br />
{<br />
get { return (anumber); }<br />
set { anumber= value; }<br />
}<br />
}<br />
I understand that I need to set the DataSource parameter of my DataGridView to my data, in some way, but I don't seem to be able to get it to work. Do I need to do something to my classes to get it to work?
I think that sums it up. No SQL, nothing just a nice list of data that I want to display.
Can anyone help? Many thanks!!
|
|
|
|
|
Hi,
Use a binding source to bind your list and then bind the binding source to the data grid view.
dataGridView1.DataSource = bindingSource1;
dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
this.bindingSource1.DataSource = myList;
Thanks and Regards
Mahen
|
|
|
|
|
Please don't cross post. You asked this same question only two hours ago. It is rude to cross post just because no one answers right away.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
And even ruder to then delete the mail leaving you dangling in the forum!
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Malcolm Smart wrote: even ruder to then delete the mail leaving you dangling in the forum!
Yeah, those are pretty bad, too.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
hi there,
i put a progress bar in my app, its working well, but when i click outside the app then app becomes white, that mean it look like the non responding prog. but its working in backgroud
i wanna know how can i make it that it should look working app?
Becoming Programmer...
|
|
|
|
|
To xmen_xwk,
you can use "Application.DoEvent();" at each loop.
---------------------------------
Believe what you saw!
|
|
|
|
|
thanks dude
Becoming Programmer...
|
|
|
|
|
Use a backgroundworker to do the work, which can then report progress to the gui thread so you can update the progress bar
I have no blog...
|
|
|
|
|
I new C# programmer and I'm attempting to write a FAST generic method that would takes types like short, int, long, float, double etc.... and put them in a byte array at a specified index. It would allow you to specify the endianess you want. I have seen a couple of answers out on the forums, but they all appeared to be handing the of data (or byte arrays)several times. I could define the same method with the specific type I want use and it will compile but then I need to duplicate this for every type that I want to use. I was hoping I could get some help on this so the method is both fast and easy to maintain.
The following is what I would like to do but it doesn't compile because "Cannot take the address of, get the size of, or declare a pointer to a managed type ('T')":
public unsafe static void IntoBytes2 <T> (byte[] byteArray, int index, T data, bool MSBFirst) where T : struct
{
byte* dataPtr = (byte*)&data;
if ((index + sizeof(T) - 1) <= byteArray.Length)
{
if (MSBFirst)
for (int i = index + sizeof(T) - 1; i >= index; i--, dataPtr++)
{
byteArray[i] = *dataPtr;
}
else
for (int i = index; i < index + sizeof(T); i++, dataPtr++)
{
byteArray[i] = *dataPtr;
}
}
}
Thanks for any help
- Nick
|
|
|
|
|
My first question would be why are you trying to reinvent the wheel?? This is already possible in the .NET Framework using the BitConverter class and Serialization using the BinaryFormatter.
|
|
|
|