|
I'm just waiting for the Satips reply now.
only two letters away from being an asset
|
|
|
|
|
I think he's using Visual C# 6.0, where intellisense fails always.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
I am using Visual Web Developer 2005 express edition and maybe it is failing but it is not working in my intelisence
Thanks for reply
|
|
|
|
|
I am not sure why but in my intllisense that comes with Visual Studio Express there is nothing for date now. Most places including msdn showing
DateTime.Now should work, but it isn't working with .net 2.0. If it working in yours please let me know if you don't mind.
|
|
|
|
|
Aleksandr71 wrote: If it working in yours please let me know if you don't mind.
Yes, it works on mine.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
"07/08/2007".ToDateTime() :->
For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16)
|
|
|
|
|
Now.ToString();
This statement is false
|
|
|
|
|
Hello,
I wish to merge horizontally and/or vertically cells in a datagridview control, mostly in its header. Does anyone know how to do it?
Thanks
Programmer in trouble
|
|
|
|
|
You don't merge in the DataGridView control, merge the underlying datasource. i.e. DataTable.Merge(), or using the db query to merge results.
only two letters away from being an asset
|
|
|
|
|
Hi
Is it possible to to add Tag or data of some kind to a combobox item?
no the whole combobox a single Item inside .
Thanks
Have a nice Day
|
|
|
|
|
Hi,
ComboBox (and ListBox) collect items of any type you choose, not just string.
So you can create a special item class to hold whatever you want, and add
instances of that class to your ComboBox.
Now you should use ComboBox.DrawMode=OwnerDrawFixed and do the item painting
yourself using the ComboBox.DrawItem event.
|
|
|
|
|
Thanks i will try
is it too much to as a for a code sample...;)
Have a nice Day
|
|
|
|
|
Good news, you dont need OwnerDraw, it suffices to provide a ToString() method.
Example:
class cbi {
public int i;
public string text;
public cbi(int i, string text) { this.i=i; this.text=text; }
public override string ToString() { return text+" "+i; }
}
public Form1() {
InitializeComponent();
cb.Items.Add(new cbi(1, "a"));
cb.Items.Add(new cbi(2, "b"));
cb.Items.Add(new cbi(3, "c"));
cb.SelectedIndexChanged+=new EventHandler(cb_SelectedIndexChanged);
}
void log(string s) {Console.WriteLine(s);}
void cb_SelectedIndexChanged(object sender, EventArgs e) {
cbi item=(cbi)cb.SelectedItem;
if(item==null) log("item=null");
else log("item i="+item.i);
}
|
|
|
|
|
Doesn't a combo box have a display item and data item property ? Or is that just a combo box in a web page ?
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 cant find such property
only Item.
Have a nice Day
|
|
|
|
|
Hi, this is an example of the technique Christian refered to:
class cbi {
private int val; public int MyVal { get { return val; } }
private string name; public string MyName { get { return name; } }
public cbi(int i, string text) { this.val=i; this.name=text; }
}
public Form123() {
InitializeComponent();
ArrayList list=new ArrayList();
list.Add(new cbi(1, "a"));
list.Add(new cbi(2, "b"));
list.Add(new cbi(3, "c"));
cb.DataSource=list;
cb.DisplayMember="MyName";
cb.ValueMember="MyVal";
cb.SelectedIndexChanged+=new EventHandler(cb_SelectedIndexChanged);
}
void log(string s) {Console.WriteLine(s);}
void cb_SelectedIndexChanged(object sender, EventArgs e) {
cbi item=(cbi)cb.SelectedItem;
if(item==null) log("null");
else {
int i=(int)cb.SelectedValue;
log("i="+i);
}
}
It uses an ArrayList (or any other collection) as the source of all ComboBox data;
each item must now have two properties, one giving the text to display, one
giving the value to be returned by ComboBox.SelectedValue
|
|
|
|
|
Thanks a lot
i am now working with the code
Have a nice Day
|
|
|
|
|
|
Hi!
I am trying to get all the file names from a selected folder.
How can i get them useing the FolderBrowserDialog.
Thanks
|
|
|
|
|
Hi!
You can't.
FolderBrowserDialog is not the correct class for this.
You can get all the files in a given directory with the Directory class (System.IO namespace).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
In the Database query I can write somthing like this:
SELECT fields FROM table <br />
WHERE somField LIKE '*someThing*'
When I tried to pass the above as the SelectCommand of the Adapter
It gives no result for the same 'someThing' which already returned results inside the database.
Can anybody explain the reason and advise a solution
Mohamed Gouda
Egypt
|
|
|
|
|
In SQL the wildcard characters are different from what you are used to.
% must be used instead of * in the query:
SELECT fields FROM table WHERE someField LIKE '%someThing%'
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Many Thanks
Mohamed Gouda
Egypt
|
|
|
|
|
Mohammed Gouda wrote: I imagined that there is Adapter.Clear(DataSet) or anything similar
To clear a DataSet, you don't need an adapter. DataSet.Clear()[^] does the job.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|