|
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.
|
|
|
|
|
|
Don't feel bad about asking 'silly' questions or being a newbie; everybody was at some stage.
A word of advice, though - don't delete questions after they've been answered.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hi,
I got a very simple XML file:
<rss version="2.0">
<channel>
<book>Book title
And want to have it printed in my c# application.
It should open the xml file from my website (http://my-website.com/books.rss), and then echo what's inside <book>.
Can anyone make simple and lightweight code do do that?
|
|
|
|
|
I can't connect app to SQLEXPRESS via the local network.
It works on same PC.
In SQL Server Configuration Manager > SQL Server 2005 Network Configuration > Protocols for SQLEXPRESS > TCP/IP and Named Pipes - set to Enabled.
In Server Properties > Security > SQL Server and Windows Authentication mode is set.
Firewall and antivirus are stopped during tests.
What else can be cause of this trouble?
Thanks for any help.
|
|
|
|
|
What is the error message?
What does your connection string look like?
What are the instance names of the two SQLEXPRESS servers?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|