|
I'm attempting to create several ComboBox controls on a windows form that are all connected to a relational database. The controls "narrow" their selection choices when any other given ComboBox is selected to an item.
Similar to say..narrowing down a motherboard model by selecting Intel/AMD --> Socket --> Chipset --> etc. As I'm quite new to working with data in C#, I was hoping someone could offer a good reference that I can use to read up on this - preferably, a beginner's reference.
Help is appreciated. =]
|
|
|
|
|
Hi Team
I need to show date in this format in my report -----------Dec'09
I am getting format like this Dec2009 for this I am using (MonthName(Month(Parameters!sdate.Value),TRUE)& Year(Parameters!sdate.Value))
Please kindly help me how to get format Dec'09 and also
How to display previous month date also Nov'09 (Need formula)
|
|
|
|
|
String date = DateTime.Now.ToString("MMM yy");
However it will return exception if you want " ' " char to be seen.
siddisagar wrote: How to display previous month date also Nov'09 (Need formula)
String date = DateTime.Now.AddMonths(-1).ToString("MMM yy");
|
|
|
|
|
I am using Sqlite in an application.
Was wondering if anybody knows limitations on the number of characters one can have when labelling a column as being of type(/affinity) TEXT?
|
|
|
|
|
I think you mean how uch data such a column can hold.
As found by using Google : http://www.sqlite.org/limits.html[^]
For your info, the google search (sqlite max text) gave me this hit in a thread referred to on the first result-page...
Nah... What's up, Doc?
CCC's solved : 1
If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
|
|
|
|
|
I am writing a c# program that uses property grids. The problem is that for some reason they are displayed in the basic graphics version, the scroll bars are the standard old grey version. The version that you got in windows 95 (i think), or if you turn on the classic theme in windows.
I beleve that the issue is with my current project because when i make a new project, and put a property grid on the form, its scroll bar are displayed correctly, in the current windows theme.
does anyone know how to fix this for my current project?
|
|
|
|
|
Hi,
AFAIK you need to call EnableVisualStyles() once to get the modern look of Controls, as in:
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
|
|
|
|
|
|
I am converting a class from VB to C# so that it can be compiled into the same assembly, but have run into something that I don't know how to handle. The class is a generic ObservableDictionary<tkey, tvalue="">. My problem is that I don't know how to implement both System.Collections.Generic.IEnumerable.GetEnumerator and System.Collections.IEnumerable.GetEnumerator since both of them need an exposed function named GetEnumerator().
The VB code is as follows:
Public Function GetEnumerator()
As System.Collections.Generic.IEnumerator(
Of System.Collections.Generic.KeyValuePair(Of TKey, TValue))
Implements System.Collections.Generic.IEnumerable(
Of System.Collections.Generic.KeyValuePair(Of TKey, TValue)).GetEnumerator
Return DirectCast(Dictionary, IDictionary).GetEnumerator()
End Function
Private Function GetEnumerator1()
As System.Collections.IEnumerator
Implements System.Collections.IEnumerable.GetEnumerator
Return GetEnumerator()
End Function
It looks to me like the VB code is renaming the GetEnumerator function to GetEnumerator1 and explicitly mapping this back to the GetEnumerator function that is being implemented, but I have never seen anything like this in C#.
Is this possible in C#?
|
|
|
|
|
Yep. I was going to type it all out, but that's a lot of typing... Heh
VB:
Public Function DoSomething() Implements A.B.C.DoSomething
End Function
C#:
public void A.B.C.DoSomething()
{
}
EDIT: There's a shortcut, by the way... Right-click the interface in the class definition, and pick "Implement Interface Explicitly"
|
|
|
|
|
I was working on conflation .... and I have 25 text boxes .. I collected this strings on an array ... But It becomes a headache for me to compare the 25 strings , and if there are similar strings I want to know how many different strings are there..... the frequency and in which index they are found ... I couldn't have the idea of the algorithm to do that ... Please just show me the algorithm and I will work out the rest my self ...
Thank you
|
|
|
|
|
Maybe you should sort them first and then your comparisons will be somewhat easier, as you can find groups without having to do repeated compares.
|
|
|
|
|
Depending on what am going to sort them ? .... is it by name .. or by wat?
|
|
|
|
|
CoderForEver wrote: Depending on what am going to sort them ? .... is it by name .. or by wat?
No idea! It's your data so you are the one who has to decide how you want the information ordered. What are your criteria for similarity and difference?
|
|
|
|
|
the similarity is just checking z words i.e checking the 25 strings ... if string1 and string 2 are the same then string 2 and 3 and soon
|
|
|
|
|
CoderForEver wrote: the similarity is just checking z words
Then I guess you sort on that ...
|
|
|
|
|
Using a NameValueCollection will do the sorting for you. If the string isn't in the collection, insert it with a count of 1. If it IS there, increment the count.
The collection will instantly tell you how many different strings there are with the Count member.
|
|
|
|
|
Hi everybody
I'm new using programming languages. I took a basic course of C++ in college. But most of my friends told me C# is more used than C++. I could prove it checking some nice projects made for CS master students.
I wanna learn everything, specially windows app. Please, give me some advices to start up. I've found some manuals and tutorials but they are so advanced for me. please put me in the right track.
Thanks!!!
|
|
|
|
|
Any book that has beginners and C# in the title is designed for you. If you understood the core concepts of C++, then C# shouldn't be all too difficult for you. Most people would fine C++ to be entirely more complicated then C#, so you have a slight advantage over them. Go to a bookstore, or library, pick up a beginners book and work through it.
|
|
|
|
|
Thanks
|
|
|
|
|
Charles Petzold's .Net Book Zero[^] is a great place to start with C#, and gives enough grounding for you to get familiar with the basics of the language and the .NET concepts.
|
|
|
|
|
|
I'd take a look at CLR via C# by Jeffrey Richter. This is a brilliant book, albeit not that simple in places, but if focuses not just on C# but on .NET itself.
C# is meaningless without the context of .NET so you need to know both.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I've a combo box, which contains Sites' names(data comes from database). One of the item is "Create new site". I would like to keep the "Create new site" item at the top of all items. I tried to accomplish this by setting SelectedValue to 0, But it didn't work. Below is my code. Please guide to solve this issue. Thanks in advance.
DataTable dtSite = new DataTable();
DataRow drNewAction;
dtSite = objSites.SelectSites();
drNewAction = dtSite.NewRow();
drNewAction["SiteKey"] = 0;
drNewAction["SiteName"] = "Create new site";
dtSite.Rows.Add(drNewAction);
comSiteList.DataSource = dtSite;
comSiteList.DisplayMember = "SiteName";
comSiteList.ValueMember = "SiteKey";
comSiteList.Tag = "Loaded";
comSiteList.SelectedValue = 0;
|
|
|
|
|
Not sure I understand what you mean by "top of all items". But ComboBoxes will display the list in the exact order they are added to the list - unless you set the sorted property. Even if you have a sorted property you can trick the combo box by starting the item text out with a character that has an ascii value less than 65, like a space or a perenthesis. This will keep the item you want at the top of the list.
Brent
|
|
|
|