|
Your question is not so clear . .but as much i can understand you want to show all the tables columns in one data grid...
For that you cannot use such a code but u may need to use UNION in your query.
So you need to select all the data in single query using union and then populate data ina single table.
You can google union .. you will get it . ..
It should be something like this :
da1 = new OleDbDataAdapter("select * from InitialApproval where InitialApproval.PrNo='"+rd.GetString(0)+"' UNION select EstimatedVal,FwdDtByPSD from PSDApproval where PSDApproval.PrNo='" + rd.GetString(0) + "' UNION select POValue,rcd_dtCC,saving from CommonData where CommonData.PrNo='" + rd.GetString(0) + "'", con);
da.Fill(ds);
|
|
|
|
|
Hi all
Im facing silly problems abt TabIndex.
Scenario is I have 5 textBox. 2 of them are in a container and other's are inside 3 tableLayoutPanel control. I want to line up or create a serial Taborder only to those all textBoxes.So that I can use key_press event on them.
If you not clear pls let me know
Thanks
|
|
|
|
|
I am not exactly sure what it is that you are asking, but it seems to me that all you need to do is to set the TabOrder for your TextBoxes to the order that you want them accessed in.
For your future reference, it is considered rude to use txtspk in CP forums (abt?, pls?). In this case I don't think it alters the understanding of your problem but it might do in another case. Remember, us old fogeys (who are often the ones that have the answers) mostly avoid posts containing txtspk. So pls dnt do it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm loading a listBox with a range (360 to -360), but I want to user to start off at value 0 (what they see). How can I do that? I've tried to use listBox.Items.MoveCurrentToPosition() and listbox.SelectedIndex = x; but neighter have the desired results.
|
|
|
|
|
See what no help and one day of sleep does?
listbox1.ScrollIntoView(value_of_collection);
is what the doctor ordered.
I swear I searched many times on CP, google but never seen one example of someone setting this. Quite strange....and even more strange that I overlooked the method so many times in intellisense/msdn.
Anyways, maybe that will help someone else.
|
|
|
|
|
Gawwwwd.
So I did that example at work a few days ago. Now I come home and work on my project and what do you know, it ain't working. Before I jump off a cliff I decided to look into it. 10,000 compiles and 10,000 "come on man!" later, and I finally got it. I mean, it's so irritating and funny when some little dumb thing like this happen. Now i'm certain I tried this method before posting my original post, but didn't work...yadda yadda.
drumroll please...
The reason is that I was using a tab container and this listBox was on the second tab, NOT in the VIEW of the application when it loaded.
So I ended up responding to the Tab events something like this:
private void tabControl1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
TabControl tc = sender as TabControl;
if (tc.SelectedIndex == 1 && selectedIndexTracker !=1)
{
selectedIndexTracker = 1;
angleListBox.ScrollIntoView(15);
}
}
|
|
|
|
|
Hi All,
I've got this on an abstract class:
public abstract IDictionary<string,MatchKey> MatchKeys { get; set; }
As I want consumers to be able to specify the type of Dictionary collection (that implements IDictionary<>) in the sub-class. When I inherit from this abstract class with this:
private Dictionary<string, MatchKey> _matchKeys = new Dictionary<string, MatchKey>();
public override Dictionary<string, MatchKey> MatchKeys
{
get { return _matchKeys; }
set { _matchKeys = value; }
}
I get a compile error "type must be IDictionary to match overridden member". Am trying to do something ridiculous here? Seems to make sense but it's obviously not correct.
Cheers,
|
|
|
|
|
Try using IDictionary instead of Dictionary in your derived class.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Indeed, that works. I was thinking that in the derived class I would be able to simply use Dictionary in its place.
|
|
|
|
|
That would break the "contract" though, the base class claims it can also accept other types of IDictionary when you really don't, so you would be going against the Liskov substitution principle (except the base class is abstract, but is that a good enough reason to not let it apply?)
|
|
|
|
|
I've just popped off to have a read on what that principle is! Interesting reading, thanks.
I was still under the impression that coding against Interfaces was a good idea. By letting consumers specify the IDictionary<T> there is a level of functionality guaranteed to be available irrespective of the concrete type used.
|
|
|
|
|
You're welcome. Interfaces aren't all bad though..
Personally I would restrict a type as much as possible (with as context, the rest of the program) unless the code is meant to be used be other people/programs
|
|
|
|
|
I'm actually working on some base classes that are going to form the data objects for a fairly hefty set of scenarios. They are used throughout our systems and need to be extensible in some situations and tied down in others (Wcf DataContracts for instance).
I've tried staying on one side of the road (Interfaces/Abstract Class) but I'm now experimenting with a little of both where appropriate.
|
|
|
|
|
If the abstract base class had just a getter, it wouldn't break the contract or the Liskov substitution principle, yet it still won't compile. C# doesn't support covariance of return types on overridden members.
|
|
|
|
|
I've got a real head scratcher here. One of my dialogs the text displayed at runtime begins one pixel farther to the left than at design time, and some spaces are 1 pixel wider at run time. I initially noticed this when the effect caused text to wrap differently.
When I created a new test form in the same project and copied the interface components into it, the problem persisted. When I created a new solution and copied the offending forms source into the new solution the problem went away.
This is happening in VS2k8. The solution it's occurring in was originally created in 2k3 and then converted to the new version.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I remember reading an article somewhere (can't find a reference at the moment) about this sort of thing. IIRC it is caused by either the designer using GDI+ and the run-time using GDI, or vice versa.
This may not be the cause in your case, but perhaps if you root around using the above info, you might be able to resolve the problem, or discount it anyway. I'll continue racking my brain, and if I remember the source, I'll come back.
[Edit]
Brain finally started working.
Look at this[^].
Lots of other goodies from googling 'text alignment gdi vs gdiplus'
Good luck!
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Interesting and that did send me down the right path. In the properties viewer under Behavior is an option called UseCompatableTextRendering . The description of it is "Specifies whether text rendering should be compatible with previous releases of Windows Forms. Setting it to true changes the rendering in the designer to match what's used in the original application in either case. Changing it in my new app (same form code) causes both the design and runtime rendering to be changed.
This strongly implies that there's a setting at the project/solution level that's overruling the designer and forcing legacy rendering in either case.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">dan neely wrote:</div>This strongly implies that there's a setting at the project/solution level that's overruling the designer and forcing legacy rendering in either case. </blockquote>
and there is: To use the new rendering call: Application.SetCompatibleTextRenderingDefault(false).
http://blogs.msdn.com/jfoscoding/archive/2005/10/13/480632.aspx[^]
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi,
i used hl7 to xml converter article, it returns a xml document as a string.
can i get it as a document itself, how? how can i read the xml document and populate my database?
|
|
|
|
|
Did you think to ask the person who wrote the article ? You can read the XML document using the XMLDocument class.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
how to create PC to PC call, give me idea, i searched in google, but i dint find any thing.
yogesh
|
|
|
|
|
I believe you are looking for skype. I am sure their is a programming SDK that you are able to use to target the service.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Thomas Stockwell wrote: I believe you are looking for skype
Ah, you assumed his use of the word "call" means a telephone call. I would never thought of that.
|
|
|
|
|
yogesh_softworld123 wrote: i searched in google, but i dint find any thing.
start here[^]
|
|
|
|
|
Is it possible to shut down a computer by programming a micro controller that is external to the computer?
|
|
|
|