This is going to be a really goofy question but is it possible to do the following in C++/CLI?
// C++/CLI
public ref class Managed
{
public:
array<double>^ m_data;
Managed(array<double>^% data) : m_data(data)
{
}
void bar(int x)
{
System::Array::Resize(m_data, x);
...
I just upgraded a project to 3.5 SP1
and trying to add a LINQ to SQL class item to the project and can't as it doesn't appear in the Add Item list.
Though if i create a new project in the same solution and try adding it the item (LINQ to SQL classes) is available and I can add it to the project.
What do i have to do to be able to add L...
Hi!
I'm writing a logging class in C# and would like to add the method from which the log call was made. Doing this manually isn't too attractive. Is there a way to know which method the currently executing code is in?
Thanks in advance for your awesomeness...
Gregg
EDIT: Using MethodBase...
System.Reflection.MethodBase thisMethod ...
I am upgrading an existing application that has implemented a home-brew Constants class in its business and datalayer objects.
I want to replace this with Nullable types and do-away with the constants class, that looks like this, but with all non-nullable data types:
class Constants
{
public static int nullInt
{
get { ...
I have a Vector class, and I was testing the following unit test (using nUnit).
1 Vector test1 = new Vector(new double[] { 6, 3, 4, 5 });
2 Vector test2 = test1;
3 Assert.AreEqual(test1, test2, "Reference test");
4 test2 = new Vector(new double[] { 3, 3, 4, 5 });
5 Assert.AreEqual(test1, test2, "Reference test");
The first test i...
Hi!
I plan to put a call to MethodBase.GetCurrentMethod() at the beginning of most methods (for informative logging), but since this would present a high overhead, it would be good if a conditional attribute could be used used like:
#define LogMethodNames
where...
[Conditional("LogMethodNames")]
was put above every line call GetCu...
Is there anyway to see what objects have had locks placed on them in the visual studio IDE?
...
I have an automation addin for excel developed using C#. How do I package and distribute it ? Also when the addin is installed for the first time, I want a username and password check to pop for the first time.
How can I go about doing this ?
thanks
...
When I run this SQl in my mobile app I get zero rows.
select * from inventory WHERE [ITEMNUM] LIKE 'PUMP%' AND [LOCATION] = 'GARAGE'
When I run the same SQL in Query Analyzer 3.5 using the same database I get my expected one row.
Why the difference?
Here is the code I'm using in the mobile app:
SqlCeCommand cmd = new SqlCeCommand(Q...
We are getting the following error message when running one of our applications. Basically the application crashe. This is the error message I found in the event viewer
EventType clr20r3, P1 winui.exe, P2 1.12.14.3979, P3 4b20fc8f, P4 system.enterpriseservices+system.enterpriseservices.wrapper.dll, P5 2.0.0.0, P6 471ebed4, P7 ba, P8 21,...
I have a function that sends email using asp.net built in mail framework. I've included it below.
public void SendMessage()
{
var message = new MailMessage();
var client = new SmtpClient();
// Get the Message Envelope Details
this.LoadMessageDetailsFromFile();
// Process rules (if any): Rules engine not implemente...
How to get MAC address of client machine in c# and vb.net
...
Is there a way to find the days that constitute a weekend or workweek based on different cultures using the .NET framework? For example, some Muslim countries have a workweek from Sunday through Thursday.
...
Hey,
Something pretty weird is happening with my app:
I have the following property in my ViewModel:
public int? StakeholderId { get; set; }
It gets rendered in a partial view as follows:
<%= Html.Hidden("StakeholderId", Model.StakeholderId) %>
The form is submitted, and the relevant controller action generates an id and updates ...
Hello all
i like to build .net GUI application and to be able to deploy it on wide windows version as possible
for non teachi persons , what should i be planning before i start to write the code like
which minimum net version to compile which GUI to use ?
include the .net framework in the installation or not ? to include net framework...
Hi everyone,
I'm relatively new in c#, & I'm wondering when to use Delegates appropriately.
they are widely used in events declaration , but when should I use them in my own code and why are they useful?, why not to use something else?
I'm also wondering when I have to use delegates and I have no other alternative.
Thx for the help.
...
I'm using NHibernate + Fluent to handle the database in my application. So far I've been using a SessionSource to create my ISession objects. I'm a bit confused now about what comes from NHibernate or Fluent, and what I really should use for creating my sessions.
ISession comes from NHibernate, and the SessionSource from Fluent. I crea...
I am going to build a player GUI control (a C# user control) for playing audio and other streamed data. The control should have at least the following controls:
Pause/Continue/Forward/FastForward etc... as Buttons (with icons)
Current position as some form of a slider
Current time as digital clock
Especially I am looking for a nice t...
I want to list all tables and their row count, in an MS Access database, in a grid view. I am using a query as follows:
SELECT MSysObjects.Name, CLng(DCount('*',[name])) AS RecordCount FROM MSysObjects WHERE (((MSysObjects.Type)=1) AND (MSysObjects.Name NOT LIKE 'MSys*')) ORDER BY MSysObjects.Name;
In MS Access Query pane this works j...
Hi,
I have a small application that builds up a xml document using XDocument. However, after a while the app is using more than 1gb ram.
So I was wondering if there is anyway to make XDocument use the disk instead of in-memory. For example by opening a StreamWriter and save it to a file on the go.
Thank you in advance.
...