.net

where is csharp source code is used sharepoint

please provide the csharp area in sharepoint. what are the part csharp source is used. how can be document loaded in the sharepoint. whether it can be done through by c sharp. ...

Should I use the WPF or SlimDX?

Here's what I want to do: I want to draw geometric primitives and maybe some form of 3D graphs and charts. I also want to be able to freely move the camera around. I want to do all this in a WPF or Windows Forms Window or maybe even render to an image. And finally, I want to be able to achieve this in a fairly straightforward manner. So,...

.NET Listview Refresh

I have the following code, which basically takes values from a database and populates a listview. using (IDataReader reader = cmd.ExecuteReader()) { lvwMyList.Items.Clear(); while (reader.Read()) { ListViewItem lvi = lvwMyList.Items.Add(reader["Value1"].ToString()); lvi.SubItems.Add(reader...

How to create Object (label, button) using Code

How to create Object (label, button) using Code? ...

Randomly crashing .net app in kernelbase.dll, running in 32 bit on Windows 7 64 bit

We have a customer running our 100% .NET product on a W7 64 bit machine. The app explicitely targets x86 so runs in 32 bit mode. On the customer's machine we get random crashes in kernelbase.dll. Sometimes it crashes even by just moving the mouse over the app. On other W7, 64 bit machines it runs ok. Any clues on how to approach this? M...

How to check if a userControl is in front of others in C#?

How do you check whether a userControl is in front of others? Is there easy way to do that? I use bringToFront method when my user control was clicked, but now I need to determine if it is in front at the moment. ...

Problem with adding an event to the combo

I have a combobox: <ext:ComboBox ID="cbGroup" runat="server" Width="150" OnItemSelected="cbGroup_ItemSelected"> </ext:ComboBox> and a method: protected void cbGroup_ItemSelected(object sender, EventArgs e) { FilterItemSelected(this, new EventArgs()); } when the item in the combobox is changed the me...

Process.Start parameter containing spaces has problems on XP?

The following code snippet runs nicely on windows vista or windows 7, but not on XP: String filename = System.IO.Path.ChangeExtension(System.IO.Path.GetTempFileName(), ".html"); [...write file...] System.Diagnostics.Process.Start("excel.exe", "\"" + filename + "\""); Problem is, on Windows XP the filename contains spaces ("c:\document...

Should a function that periodically returns bitmaps re-use them?

I have a function that returns a bitmap meant to be used as background in a panel, and occasionally I'd have to call it to create a new background based on parameters. (Since there are two drawing functions for this panel (the background doesn't need to be changed as often as the foreground) it's not a matter of just drawing on the Pain...

How to transfer a large zip file(50MB) using a WCF Service thorugh SOAP to aby client?

I have a WCF Service that returns a byte array with a ZIP file (50MB) to any client that requests it. If the zip is very small (say 1MB), the soap response is coming from WCF with the byte array embedded in it.But the response size is very huge even for a 1MB file. If i try the 50MB file to get transferred the Service gets hanged and thr...

Retreive all Children and their Children, recursive SQL

Consider the following rows in a database: Id | Parent __________________ 1 null 2 1 3 2 4 3 5 null 6 5 Each Id that has a null Parent is the "Owner"/"Super Parent". What would be the best approach, performance wise, to collect the parents and their children ? Shoul...

Web Service parameters' types when accessing axis2 service from .NET client

I have created a axis2 webservice including a method with multiple parameters: class Service { public void method(string a, Enum b) { } } When accessing with a .NET client, the code generated in the client side is: void method(methodRequest request) instead of having the two original parameters, and in addition methodRequest....

How to add custom sections inside custom section groups in app.config file at runtime ?

I want to dynamically add a custom section inside a custom sectiong group of the App.config for my .net application. I basically have 3 different environments which use the these custom sections and need to decide which one to have in my app.config file. I am currently able to edit the config file and add the custom sections and custom g...

How do you incorporate "/x" option parameters into a .NET console application?

A lot of command line utilities use parameters, such as: gacutil /i MyDLL.dll or regasm /tlb:MyDll.tlb MyDll.dll How do I set up a .NET console application to take in command line arguments and, secondarily, how can you emulate handling "option" parameters like /i and /tlb: in the respective examples above? ...

How can I modify strings using a "For Each" loop?

'Why doesn't this work? Dim myStrings As String() = New String() {string1, string2, string3,} For Each s As String In myStrings If String.IsNullOrEmpty(s) Then s = "" End If s = "-" & s.Trim() & "-" Next If string1 contains "foo", my intention is that string1 contains "-foo-" aft...

Format DateTime in an EF query

I have a database table that holds information for received files. One of the columns is a DateTime that specifies when the file was received. I need to get a distinct list of months with the year (MM/YYYY) for files received. I need to get it out of this table. There can be thousands of records in this table so the way I have done it, i...

Maintaining .NET assembly references common to multiple projects

Hey all, My colleagues and I have been wondering the best way to do this for quite some time: what's a good/standard way to maintain .NET assemblies that are referenced in multiple projects? I'll elaborate a little bit: Say you have projects A, B, and C. They could be in the same solution or different solutions, doesn't really matter. ...

XSLT transform creates StackoverflowException

I tried to perform XSLT transform of a XSD file. My goal is in the end to create SQL from XSD. So far so good, this is what I have: void Convert() { XPathDocument xpathDoc = new XPathDocument(@"myschema.xsd"); string xslPath = @"convert.xsl"; XslCompiledTransform transform = new XslCompiledTransform()...

FileStream.EndWrite throws an exception (.NET)

I'm trying to implement the progress notification mechanism when copying files. I'm doing this in the following way: I create two FileStreams - for reading and writing Call the BeginRead passing to it a ReadCallback and a structure containing the reading stream and the array to fill with the data read from a file. In the ReadCallback I...

StreamWriter flush() call performance impact

We have a Log class which write log entries into a log file via StreamWriter. Each time when its logItem() is called, an entry will be passed in and write to the file. Right now after the WriteLine() method call, a Flush() is also called. Do you think it is necessary to call Flush() for each write? any performance impact? ...