|
Cenatar wrote:
what happens when I get a project from the server(or database) and I want to see what resources that is connected to it?
What do you mean? That depends on how you want to implement it, what technologies are abailable and so on.
If you are concerned about large ammounts of data transferring in one go you could implement a lazy fetch algorithm. In other words, you get the project as your starting point. Then if you need to iterate through the list of resources, you'll access that collection through a property and the internal code of the property checks whether the information is available yet and if not builds the collection by fetching the relevant data from the database. The resource object will expose properties that get you to the project and employee with a lazy fetch algorithm, since the project already exists that reference will be reused, but since the employee doesn't exist in your application any attempt to get the employee property will, for the first time, perform a database lookup.
Be warned that over zealous use of lazy fetch (aka lazy lookup) algorithms can hurt performance, however some uses, like in matrix classes (and this is more of a lazy calculation, than lookup) can work very well if you don't need to know everything about the matrix. As a general rule, try and fetch as much as possible in one request (without fetching so much the user is left waiting) because it reduces network traffic (one request and lots of data in the reply, rather than lots of requests and lots of replies - which probably won't fill network packets efficiently).
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
|
|
|
|
|
Hi,
I'm trying to set a mailto option in a Windows Form that will send an attachment (eg: WordPad has this feature, call "Send").
This is as far as I got...
System.Diagnostics.Process.Start("mailto:?attachment=" + fileNameWithPath);
Not working though... any help is greatly appreciated )
Ron
|
|
|
|
|
Many MAPI clients do not support attachment in the mailto: pluggable protocol. Outlook and Outlook Express are two that don't support that.
The only way to do it that is application independent is to use Extended MAPI, which must be wrapped. You can also use simple MAPI, but Outlook XP and newer will prompt the user with annoying questions (Microsoft "fix" to all the Outlook-related problems).
One such article that is pretty good is Simple MAPI.NET[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I want to color a column in a datagrid . How do I do this?
Karteek
|
|
|
|
|
I told you how the last time you asked this: by extending the DataGridColumnStyle with your own class nad overriding the necessary properties and methods. You must then define your DataGridTableStyle s and DataGridColumnStyle s explicitly. See DataGrid.TableStyles in the .NET Framework SDK documentation for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Hi,
I do not know the number of coulmns in the table or name of the columns. I am dynamically reading the table data from the database. In that case how can I set the mappingname,column name etc... Is there a way to get these while reading data from database.
KArteek
|
|
|
|
|
DataSetObject.Tables[0].Columns gives you the collection of the columns, you can set mapping name to any string value
(like someName+ i // i is the column number).
I think u need to solve the problem logically (I guess, not sure)
|
|
|
|
|
Does anyone know of a way to keep the user from deleting or adding rows in a dataGrid when it it being displayed. They need to be able to edit the data. Thanks in advance.
|
|
|
|
|
You can bind against a DataView with the AllowNew and AllowDelete properties set to false . You could also set these properties on the DataTable.DefaultView property, which returns a DataView over the DataTable .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've seen NetMaster's article on DirectShow (DShowNET) and was excelent in my opinion.
Simple file playback is a joke with this tehnology , but I was wandering about playback from memory or netsockets.I don't mean capture cards , but simple file pre-procesing before playing. As an example , let's say that I wanna send to the filter just the images I want from a movie.My program will take care of pre-procesing but that implies that the filter will be forced to receive input from memory or , in the worst scenario , from a network socket. I've read about MPEG-2 Demultiplexer filter in the DirectX 9 SDK add-on , but I can't quite make it work.
If anyone can help me pls provide an example ( best in C# )
Thanks.
Angel
|
|
|
|
|
Is it possible to implement methods from an interface class as internal in C#? From my first try, it doesn't look like it is possible (the project won't build):
<br />
public interface IMyInterface{<br />
string Name{ get; set; }<br />
}<br />
<br />
public class MyClass : IMyInterface{<br />
internal string Name{ <br />
get{} <br />
set{}<br />
}<br />
}<br />
<br />
...this results in a build error.
But this IS possible to do in VB.Net:
<br />
Public Interface IMyInterface<br />
Property Name() as String<br />
End Interface<br />
<br />
Public Class MyClass<br />
Implements IMyInterface<br />
Friend Property Name() as String Implements IMyInterface.Name<br />
Get<br />
End Get<br />
Set(value as String)<br />
End Set<br />
End Property<br />
End Class<br />
...this generates no errors.
Why is this? If VB.Net can do it, the CLR must allow it, so why can't C# do it?
Would it be because an internal class member defined in an interface doesn't make much sense from a design standpoint? In other words, an internal interface member kind of defeats the purpose of creating an interface in the first place. Is this just a well-thought-out constraint of C#?
- Mike
-------------------------
"No human being would stack books like that." - Dr. Venkman
|
|
|
|
|
C# can, but you're mixing implementation types. You do this in C# using explicit interface implementations, which is what youre VB.NET snippet is doing:
public class MyClass : IMyInterface
{
void IMyInterface.MyMethod()
{
}
} Notice that there's no access modifier. This would be private. This fairly common throughout the .NET FCL. Think about ADO.NET: there's several interface methods but they're all typed; the explicit interface implementation still works and is used to essentially "hide" the "generic" method so that a typed method can be used.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Makes perfect sense. This actually helps open up some other doors that explain a few other things. Muchas gracias.
- Mike
-------------------------
"No human being would stack books like that." - Dr. Venkman
|
|
|
|
|
How can I read the bitmap file pixel by pixel? I need some code.
|
|
|
|
|
Load the file into a Bitmap object and call its GetPixel method.
Bitmap myBitmap = new Bitmap("Grapes.jpg");
Color pixelColor = myBitmap.GetPixel(50, 50);
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
|
Hi all
I have currently learning to program in C#. I am inspired by the A* path-finding C# algorithms written by Eric Marchesin.
I like to seek help on the implementation of Potential Field Method for robot navigation.
Can anyone show how the complex objects( such as goal, robot, multi-shaped obstacles) can be created systematically ? I am really at a lost.
Other challenges include solving local minima problem and intelligent navigation.
Anyone who has the expertise.Please your help is very much appreciated.
|
|
|
|
|
sodium wrote:
Can anyone show how the complex objects( such as goal, robot, multi-shaped obstacles) can be created systematically ?
What do you mean by "systematically"?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
methodically would be a better description. Dave, are you capable ?
|
|
|
|
|
Nope. Never touched Navigation algorithms...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
I am having a problem with xsd convertion to csv file. The code below describes how I attempted to approach the problem. The code works but the output is not properly format.
ObjBISReports As DsReports (a type dataset)
.. after the dataset has been filled using sqldatadapter
ObjBISReports.WriteXml("C:\Tunde.xml", XmlWriteMode.IgnoreSchema)
Dim xslt As New XslTransform()
xslt.Load("F:\Alliance International\Projects\AIA Database Application\Application2\Components\GetOutStanding.xslt")
Dim doc As New XmlDocument()
doc.Load("C:\Tunde.xml")
'Create an XmlTextWriter which outputs to a file.
Dim fileName As String = "C:\tunde.csv"
Dim writer As XmlWriter = New XmlTextWriter(fileName, Nothing)
'Transform the data and send the output to the console.
xslt.Transform(doc, Nothing, writer)
writer.Close()
This is the stylesheet format:
"<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="DsReports">
<xsl:apply-templates select="GetOutStandingBills"/>
</xsl:template>
<xsl:template match="GetOutStandingBills">
<xsl:for-each select="*">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>"
Please if anyone knows a much effective means of converting xsd to csv or excel could you let me know.
Thank You
Tunde Olawuwo
|
|
|
|
|
Notice you're using VB.NET - this belongs in the VB.NET forum. But since it really has more to do with the XSLT, the answer is simple: you must set the xsl:output method (assuming xsl is your namespace prefix for the XSL Transform namespace) so that the method attribute is just text . Then you must make sure that a new line is output after the last element in the CSV. A simple way is to output a CR-LF pair like so:
<xsl:text disable-text-escaping="yes"> </xsl:text>
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
oops sorry for posting vb question in a C# region. Thanks I appreciate it!
|
|
|
|
|
How can I recognize the characters in a bitmap using c#?
(Im doning OCR prgram)
|
|
|
|