Hi,
I want to use Server.MapPath() method im order to map a virtual directory
I created to its physical path.
The thing is that the .net environment doesn't recognize Server.MapPath().
Google told me I'm supposed to use HttpContext.Current.Server using System.Web,
but HttpContext isn't recognized in spite of me using System.Web. (And ...
I've written a COM interop enabled class-library in C# using .Net 3.5. The object is meant to provide some utility functions for classic ASP pages. I've written a test.asp page which instanciates the desired object and calls its methods. Works fine on my machine.
On a different machine (Windows Server 2003 - Standard Edition) it doesn't...
Hello all,
I am using c#.net
I have a repeater within a View (MultiView) each row contains a ‘Edit’ button (stored on the CommandArgument is the type ID).
<asp:Button ID="buttonClick" OnCommand="ButtonClick" CommandArgument='<%#Eval("ID")%>' runat="server" Text="Edit"/>
When the user clicks on the ‘Edit’ button they are taken throu...
Hi all,
I am using Ajax.dll.I have registered the class using
Ajax.Utility.RegisterTypeForAjax(typeof(Default)) in page load.
I have written a function in the server side to return "Name",like
[Ajax.AjaxMethod(HttpSessionStateRequirement.ReadWrite)]
public string GetName()
{
return "Test";
}
and i accessed from the page like
Defa...
I'd like to programatically determine the "publish location" (the location on the server which contains the installation) of the click-once application I'm running. I know that the appref-ms file contains this information and I could parse this file to find it but the application has no idea as to the location of the appref-ms file and I...
I'm trying to write a little SQL Helper. I have a query like this stored in a string:
DECLARE @V1 INT
--ignore
DECLARE @V11 INT
DECLARE @V12 INT
--endignore
DECLARE @V2 INT
--ignore
SELECT * FROM SampleTable
INNER JOIN AnotherSampleTable
......
--endignore
SELECT * From Employee ORDER BY LastName
My helper method should cut everyt...
We have an application that runs in multiple threads and uses Log4Net as logging framework. We encountered a scenario where some log events weren't logged. As mentioned in the docs, the FileAppender and the other Appenders are "not safe for multithreaded operations".
I searched the web for solutions or Appenders, but couldn't find any.
...
Hi,
I'm needing to import an Excel spreadsheet into my program and have the following code:
string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;IMEX=1;HDR=NO;""", MyExcelFile.xls);
command.CommandText = "SELECT * FROM [Sheet1$]";
(Note, code above isn't real cod...
System.Threading.Thread.Name is a write-once property. I can assign to it at once, and only then if no other assignment has been made by application or library code. I am writing a multi-threaded event-driven application and would very much like to be able to change the name of the currently executing thread depending on the task its per...
I have the following case:
public interface IPerson { .. }
public class Person : IPerson { .. }
public class User : Person { .. }
Now; if I have a "User" object - how can I check if this implements IPerson using reflection? To be more precise I have an object that might have a property SomeUser, which should be of some type i...
I'm studying the .NET Remoting and I see an example on: http://www.mctainsh.com/Articles/Csharp/RemoteCallback.aspx#A%5Fsimple%5Fexample ,all works good. Now my problem is if I try to start another client, server don't callback to all clients connected but only to last one. How can I send callback to all clients?
...
I have begun developing an application using the Entity Framework.
I have added a namespace to contain all of my user management code MyApp.Users for example, and this contains a model that has been marked internal to the namespace and only exposes functionality to the rest of the system via interfaces. This is all good.
I now wish to ...
Hi,
I have an existing winforms application developed using VS 2005 and .net framework 2.0.
Now we need to globalize this application. The two locales are German and Japanese.
I know we can use form's localize property to create localized form resources and can have other resource files for strings used in message boxes, exceptions et...
Can we create tables dynamically in MySQL? If so, how?
Dynamic means at run time....ie via procedure AND HOW????
I am using dotnet
Ans--> yes we can create...but problem is i want to change the name of table each time the procedure is called....
...
I want to remove a particular tabpage from the tabcontrol. For which i have the value of tab name which has to be closed.
But, when i use..
for (int i = 0; i < myTabControl.TabPages.Count; i++)
{
if (myTabControl.TabPages[i].Name.Equals(tabToRemove, StringComparison.OrdinalIgnoreCase))
{
myTabControl.TabPages.RemoveAt(i...
Consider an application which is implemented using MVVM, in which the user inputs data.
When the user selects "open file", "new file" etc., the application asks the user if he wants to save the data to a file before invoking the requested command. However, if the user did not change any data since the last save, the application should sk...
Hi.
I have a component that uses log4net. I want to create unit tests, that validate that certain error conditions result in the correct logging.
I was thinking that the best way to do this is to create an ILogAppender implementation, for example a mock. I would then add the log appender to log4net during test setup, inspect what was w...
Let's say we have version 2.0 of an application deployed with around 3000 users already running the application.
So far, the application was unsigned(signed by some auto generated certificate from VS).
The users are using .NET 2.0.
Now we would like to deploy a new version that will be signed using a certificate from tucows. One of t...
Hi,
I've implemented a custom lookup column, but I'm encountering the damnedest thing with the VS designer. The column has four string properties in addition to the standard column props. Now, if I select the column from the component list in the property grid, then set the properties, everything seems to work fine. However, the moment ...
Hi,
I am struggling a bit to understand how the new AAA syntax works in Rhino Mocks. Most of my tests look like this:
[Test]
public void Test()
{
//Setup
ISth sth= mocks.DynamicMock<ISth>();
//Expectations
Expect.Call(sth.A()).Return("sth");
mocks.ReplayAll();
//Execution
...