|
Can I work with linq using visual 2005 ?
Is there any kind of extension ?
Does it also mean that I can use xlinq (linq to xml) ?
|
|
|
|
|
It may be possible, if you have the .NET Framework 3.5, to use the Linq namespace in Visual Studio 2005, but you will not be able to use the LINQ syntax as they are a part of the C# 3.0 compiler. But since this syntax is just sugar that compiles down to using the appropriate classes then you can probably still use it, it will just not look as pretty.
|
|
|
|
|
Linq has been introduced as part of .NET 3.5, which doesn't run in VS2005. I'm afraid you need one of the VS2008 editions. Once you get it, you can use DLinq and XLinq to your hearts content.
|
|
|
|
|
You can use LINQ in almost any data source, its the higher level code that uses it not the backend database.
|
|
|
|
|
Hi Guys,
I need to create an Application in C#/ASP.NET which can create an Website in SharePoint 2007.
Please send me information regarding this.
thank you
Mohamed Nazeem
Software Engineer
Bangalore
|
|
|
|
|
hai i need to open an excel file when i click on the open button i need to open in visible mode of excel file it means just display the excel file using c#
|
|
|
|
|
maybe this helps u:
exap = new Microsoft.Office.Interop.Excel.ApplicationClass();
if (exap == null)
{
MessageBox.Show("can't load excel");
System.Windows.Forms.Application.Exit();
}
exap.Visible = true;
|
|
|
|
|
Hi
I'm developing a tool that manages a lot of bitmaps, and very big ones; at some point it hits the 1gb limit that all windows apps have and it causes an "out of memory" exception.
The out of memory exception is expected due to the amount of bitmaps loaded, no memory leaks nor bad memory management.
I developed a "image server" that loads the images on demand, and if it hits an out of memory exception, it is able to temporarily release least recently used images.
Now, what I would like to do (and I have absolutely no idea on how to do it), is to capture the "out of memory" exception for the whole application, essentially, these are the events I would like to control:
- somewhere in the application an amount of memory is requested
- there's not enough memory and an "out of memory" exception is thrown
- "somehow", trap the exception, and call the image server to free some resources
- retry again the allocation, and if successful, continue executing the app normally.
- if the retry fail, try again to free some more resources (if possible), and if it is not possible, finally throw the "out of memory" exception.
Is this possible? I'm pretty new to C#, but I guess that, since the GC is in charge of managing the memory, trapping the memory allocation exception should have to be done through the GC api, right?
Thanks in advance
|
|
|
|
|
Are you calling Dispose on your bitmaps when you're done with them ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes, I'm calling dispose as soon as I don't need them. As I said, the out of memory exception is expected, due to the size of the bitmaps being loaded
|
|
|
|
|
Hi,
you may want to read up on the WeakReference class; it allows to hold on to as much data
as possible without ever hitting an out-of-memory situation.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
thanks a lot for the WeakReference hint, I've read a bit about it and it looks exactly what I'm looking for!
|
|
|
|
|
Hello,
I'd like to Resize a control that contains any text.
If I use TextRenderer.MeasureText there is always a Padding, also if I use the Flag NoPadding:
Size size = TextRenderer.MeasureText("dddd", this.Font, new Size(Int32.MaxValue, Int32.MaxValue), (TextFormatFlags.NoPadding));
I found out that i need to set a IDeviceContext like that:
private void MyControl_Paint(object sender, PaintEventArgs e)<br />
{<br />
Size size = TextRenderer.MeasureText(e.Graphics, "dddd", this.Font, new Size(Int32.MaxValue, Int32.MaxValue), (TextFormatFlags.NoPadding));<br />
}
My Problem is:
I dont want to Resize the Control in the Paint-Event, so I guess I need to get somehow the current IDeviceContext, but how?
Or do I use the TextRenderer.MeasureText method in a wrong way?
Thank You for Your Answers!
|
|
|
|
|
|
Don't forget to dispose of the Graphics object you just created.
It's a very common mistake that leads to resource leaks.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi to all
I had written a ASP.NET WEB App for uploading files on to the server running in Win-2003. I am getting Access Denied Error when i try to upload the files when the application is running. The uploaded files should be stored on another server.
What i did is - We have 2 servers both running on the same Win-2003 OS on Server1 i published by Web App and i want to upload the files to Server2 having shared folders which are accessible to only the users(basically user based authentication is permitted) from the Web App i gave the shared folder path and i Impersonated the User using WindowsIdentity, but still i am not able to access my own folder on the drive.
Can anyone help me out in this?????
Avinash Deshpande
|
|
|
|
|
I am new to VS2005 and C# and only involved with desktop programming. I need to email reports to Customers with only IE and Outlook Express. The Pdf file created by exporting from ReportViewer is 1mb. The body of my reports contain tables and line graphs. Is it possible to do away with ReportViewer and create reports that can be Viewed and Emailed directly from the IE browser. If so what technologies would I have to use eg. Webforms. How do I accomplish this. Thanks
RS
|
|
|
|
|
Hey! i need to get input from a external device. how do i connect to that device to get the information?
|
|
|
|
|
What kind of device...Mouse...Scanner...Fridge??
A craft is an enemy if not well learned.
|
|
|
|
|
Lol21 wrote: Hey! i need to get input from a external device. how do i connect to that device to get the information?
Get the right kind of cable, plug it in (on both ends), and there you go...
|
|
|
|
|
OpenFileDialog ofd = new OpenFileDialog();
ofd.InitialDirectory = @" \\";
ofd.Filter = "Excel Files(*.xls)|*.xls|" + "All Text Files(*.*)|*.*";
ofd.FilterIndex = 1;
if (ofd.ShowDialog() == DialogResult.OK)
{
excelApp = new Excel.Application();
workBook = excelApp.Workbooks.Open(ofd.FileName, 0, true, 5,
"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
0, true,1,0);
When i run this code i get an error as "Unable to cast COM object of type 'Excel.ApplicationClass' to interface type 'Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID ""
plz any one help me in this
Regards Ramya
|
|
|
|
|
use Excel.ApplicationClass() instead of Excel.Application() ..
|
|
|
|
|
This is a simplified information from the log file on a machine about an unsuccessful setup.
can you see what is wrong?
Please note that the setup does work on some other machines.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Documents and Settings\nguyent\Desktop\PricingAnalytics.application resulted in exception. Following failure messages were detected:
+ Downloading file:///C:/Documents and Settings/nxyz/Desktop/PricingAnalytics_1_0_0_11/PricingAnalytics.exe.manifest did not succeed.
+ Could not find a part of the path 'C:\Documents and Settings\nxyz\Desktop\PricingAnalytics_1_0_0_11\PricingAnalytics.exe.manifest'.
Thanks
|
|
|
|
|
Hello,
The first log shows that the activation was for user nguyent and the second log shows that the activation was for nxyz.
Can you please look into this and let me know if this does not resolve this issue.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
<Payment>
<PaymentReference />
<PayFrom PFPayerName="TRANCENTRIX INC" PFAccountNickname="1470820787" PFBankName="U.S.BANK" PFRoutingCode="B042000013" />
<PayTo PTPayeeID="john1" PTPayeeName="TECHTRONICS INC" PTRoutingCodeType="1" PTRoutingCode="154325152" PTAccountType="22" PTAccountNumber="1" PTPaymentMethod="5" PTCurrencyCode="USD" PTAmount="161155.77" />
</Payment>
The above xml file node has so many child nodes named <payment></payment>.
I want the code for counting number of attributes in that node.
I counted the number of nodes in that file as
XmlDocument doc = new XmlDocument();
doc.Load("D:/SAMPLEXML.xml");
int count = doc.SelectSingleNode ("//Payments").ChildNodes.Count;
TextBox1.Text=count.ToString();
now i want to count the attributes in one node i.e payment
Ravi Shankar M
-- modified at 4:53 Friday 30th November, 2007
|
|
|
|