|
Hi all,
Could anyone recommend a good article on how to design ADO.Net in an OOP design in C#? I'm having trouble understanding the subject, as although it's easy to drop data adapters and binders on to a form, this strikes me as being much akin to traditional VB 6 methods of handling data access, and putting lots of logic in the form itself.
Cheers,
Martin.
|
|
|
|
|
Create a DAL component (Data Access Layer).
Implement methods like ExecuteSelect, ExecuteInsert and stuff like that .
this component should handle the connections and other objects .
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
or use Microsoft Enterprise Library's Data Access Block
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
Hi all!
I am coding an application, which will allow the user to pick a font for their text, in an MS Word fashion (A combobox in the toolstrip). I have managed to create the ToolStripComboBox and populate it with the fonts, but I also want the items in the combobox show their respective fonts, eg Arial would be written in the font Arial.
I think that you must do some custom painting for what I want, but how? If I override the Paint() function it draws everything under the combobox. If anyone could provide me with an example/point me in the right direction I would be grateful!
- Martin
-- modified at 5:49 Friday 28th April, 2006
|
|
|
|
|
|
That's in VB and I'm using C#, could you point me to something which is written in C#?
|
|
|
|
|
Read here about ComboBox using.
Best regards, Alexey.
|
|
|
|
|
|
Look here.
Enjoy !
Best regards, Alexey.
|
|
|
|
|
Hmm... The problem is that that is a regular ComboBox, and mine is a ToolStripComboBox, I think that's the problem. Because when I try to override the DrawItem method it says 'No suitable method found to override', even though I have defined my own.
|
|
|
|
|
There doesn't seem to exist a DrawItem event in a ToolStripComboBox. That means that there is no way to do what I want to.
|
|
|
|
|
|
i have serial jpeg codes, how to convert to bmp file?
And display bmp file?
|
|
|
|
|
Load them into a Bitmap object and then use the Save method. Yes it is as simple as that.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I don't understand that how to load jpeg code into a bimap object.
can you instantiate?;P
|
|
|
|
|
Everything you need is inside the Bitmap class.
Look it up on MSDN to see what methods are there for you.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
using System.Drawing;
using System.Drawing.Imaging;
Image img=Image.FromFile(@"C:\image.jpeg");
img.Save(@"C:\image.bmp",ImageFormat.Bmp);
Graham
|
|
|
|
|
Can you convert this c# asp.net 2.0 html source code to vb.net please?
CssClass='<%# Eval("DepartmentID").ToString() == Request.QueryString["DepartmentID"] ? "DepartmentSelected" : "DepartmentUnselected" %>'>
|
|
|
|
|
it should be pretty similar
CssClass='<%# (DepartmentID.ToString() == Request.QueryString["DepartmentID"]) ? "DepartmentSelected" : "DepartmentUnselected" %>'>
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
This does not work in vb.net.
May be there should be iif
|
|
|
|
|
Sorry, my bad I misread your post and thought you asked for this to be converted from VB to C# - i now see you wanted th other way round.
So maybe it should use iif which is does like:
iif(condition,trueResult,falseResult);
try:
CssClass='<%# iif(DepartmentID.ToString() == Request.QueryString["DepartmentID"],"DepartmentSelected","DepartmentUnselected") %>'>
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-- modified at 6:50 Friday 28th April, 2006
|
|
|
|
|
Yes, I am aware of the iif , but can not get the c# code to convert to vb.net
Thanks
|
|
|
|
|
VB uses = instead of ==.
---
b { font-weight: normal; }
|
|
|
|
|
is this ok?
CssClass='<%# (DepartmentID.ToString() = Request.QueryString["DepartmentID"]),"DepartmentSelected" : "DepartmentUnselected" %>'>
|
|
|
|
|
Where did iif go?
---
b { font-weight: normal; }
|
|
|
|