Click here to Skip to main content
15,351,871 members

Comments by Nathan Stiles (Top 36 by date)

Nathan Stiles 24-Jan-13 21:45pm View
   
Reason for my vote of 5 \n Because I wrote it!
Nathan Stiles 2-Nov-12 2:30am View
   
There are probably 20 different ways to solve this issue. You need to get creative. Decide when the data should be inserted, and only let the insert happen at that point. If the data is inserted into the DB, show the user something, change the page, show an lol cat, anything, just make it happen!
Nathan Stiles 2-Nov-12 2:24am View
   
Deleted
This is such a simple, straightforward question. OP came for coding help not an English lesson.
Nathan Stiles 20-Aug-12 3:06am View
   
Stop copying me.
Nathan Stiles 29-Jul-12 2:00am View
   
@raditya_k's account is protected.
Only confirmed followers have access to @raditya_k's Tweets and complete profile. Click the "Follow" button to send a follow request.
Nathan Stiles 28-Jul-12 0:02am View
   
True +5
Nathan Stiles 27-Jul-12 23:38pm View
   
Deleted
There is painfully obvious SQL injection going on here.
Nathan Stiles 4-Jul-12 2:43am View
   
Request.Form ??
Is it actually posting data? Did you check the network request in the browser?
Nathan Stiles 4-Jul-12 2:27am View
   
Data URL support is quite limited. Does the toDataURL function return a valid result? and you just cant use it or does it actually fail?
Nathan Stiles 1-Jul-12 11:21am View
   
Yes I do know at design time how many calls exist. But that does not lighten the load, they still need to be counted manually.
Nathan Stiles 1-Jul-12 11:19am View
   
Yes I did write this. Thank you.
Nathan Stiles 1-Jul-12 11:18am View
   
It's not strictly impossible. It becomes quite a heated philosophical debate. But I take the stance that nothing, especially in programming is impossible. Can one write a program to check if another program will ever return?

Just to clarify. If you reread the original question. It's quite clear. There are no dynamic calls, loops, conditional measures, or anything. It's just one method called several times within another method.
Nathan Stiles 30-Jun-12 22:48pm View
   
No you just forgot to google first.
Nathan Stiles 30-Jun-12 22:42pm View
   
IIS has been giving false 404 since windows xp whatever version that was.
Nathan Stiles 30-Jun-12 13:56pm View
   
Thank you!
Nathan Stiles 30-Jun-12 13:54pm View
   
Well if this is a thrown exception then you need to catch that. Log as much information as you can. Find the type of the exception cast to the type and try to read values from all the poerpeties explore all the methods vfariables etc etc.
Nathan Stiles 30-Jun-12 13:51pm View
   
This does do what I was seeking. I understand that it's diffacult(not impossible) to determine the number of calls that will be made. But my task was to count the nmber of references to a method not the number of actual calls.

Well if someone else posts an actual working solution I will accept that. But for now my solution is the only one available.
Nathan Stiles 29-Jun-12 23:16pm View
   
See solution...
Nathan Stiles 29-Jun-12 23:02pm View
   
Do you mean the same navigator for each tab? You have to set the properties when the tabindex changes on the tab control.
Nathan Stiles 24-Apr-12 11:03am View
   
Not sure if this is true in ASP but in WinForms when you take a DateTime object and call ToShortDateString you get a culture specific format of the date that should be a format familiar to individuals of that culture.
Nathan Stiles 18-Apr-12 23:19pm View
   
Like was said above stored procedures are really the best way to go, only slightly more more work in the beginning but you may be thanking yourself later as it lets you basically create an API for your data and helps prevent unintended actions. You need to look up triggers, what they are and how they're intended to be useful.
Nathan Stiles 18-Apr-12 23:12pm View
   
DataTable.Select Method (String, String) may help. See http://msdn.microsoft.com/en-us/library/way3dy9w.aspx
Nathan Stiles 7-Apr-12 14:08pm View
   
I've played in silverlight and what I tended to do was inherit my user controls from a class that would lazy load the ServiceClient. I preassigned event handlers in that class and had them call virtual methods. Then in codebehind I would just override the methods in the base class so it was much cleaner.

Problems I see in the above model now I tended to continue to use .asmx for services anyway, I was writing a project that needed to be distributed to different servers and therefore made calls to different urls so I need to control the instanciation of each client so it would contact the correct server. I was able to do that in the base class and didnt have to worry about it every time.

Hope that helps.
Nathan Stiles 5-Apr-12 12:22pm View
   
btnNext.Text = "Next";
Nathan Stiles 10-Feb-12 0:31am View
   
What? Membership can't be null, it's a static class.
Nathan Stiles 5-Feb-12 15:46pm View
   
Deleted
Yup you're definitely doin it wrong.
Nathan Stiles 23-Jan-12 15:23pm View
   
Knowing that you have much else going on in the code makes me a bit skeptical. Did you reproduce this with a completely empty windows forms project only adding the button and the browserdialog?
Nathan Stiles 23-Jan-12 15:09pm View
   
amp_dude: Are you debugging when you see this behavior? Does control return to VS2010 after you close the form? Are you sure you're not seeing the whatever.vshost.exe in taskmanager?
Nathan Stiles 23-Jan-12 15:06pm View
   
I use the using because if the code before the dispose call throws an exception then I don't think the dispose call is hit.
I simply do this:
using (FolderBrowserDialog fbd = new FolderBrowserDialog ())
{
if(fbd.showdialog == DialogResult.OK)
{
//whatever here
}
}
Nathan Stiles 21-Jan-12 10:33am View
   
I can't reproduce this in 32bit Windows 7 .NET 3.5. Both my debug and release assemblies were removed from memory when I closed the form. I usually wrap disposable objects in a using statement.
Nathan Stiles 21-Jan-12 10:24am View
   
You can also try System.IO.Directory.Exists
Nathan Stiles 21-Jan-12 1:54am View
   
Are you familiar with data access at all or is this your first attempt?
Nathan Stiles 21-Jan-12 1:33am View
   
Deleted
using System;
using System.Reflection;

namespace ReflectRefCount
{
static class Program
{
static void Main()
{
Type t = typeof(A);
MethodInfo mi = t.GetMethod("E");
MethodBody mb = mi.GetMethodBody();
byte[] byEmptyMethod = mb.GetILAsByteArray();
mi = t.GetMethod("D");
mb = mi.GetMethodBody();
byte[] byMethodOneCall = mb.GetILAsByteArray();
byte[] byCallSig = new byte[byMethodOneCall.Length - byEmptyMethod.Length];
for (int i = 0; i < byCallSig.Length; i++)
{
byCallSig[i] = byMethodOneCall[i];
}
mi = t.GetMethod("B");
mb = mi.GetMethodBody();
byte[] byMethodTarget = mb.GetILAsByteArray();
int cnt = match(byCallSig, byMethodTarget);
}

private static int match(byte[] needle, byte[] haystack)
{
int result = 0;
int end = needle.Length - 1;
for (int i = 0; i < haystack.Length; i++)
{
bool match = true;
int pos = 0;
while (match)
{
match = false;
if (haystack[i+pos]==needle[pos])
{
match = true;
}
if (pos == end)
{
if (match)
{
result++;
}
break;
}
pos++;
}
}
return result;
}

public class A
{
public void B()
{
C();
C();
C();
C();
C();
}
private void C()
{
}
public void D()
{
C();
}
public void E()
{
}

}
}
}
Nathan Stiles 16-Jan-12 13:39pm View
   
Sorry to confuse you. The goal is to find a count of references to methodB. Basically the same count you would get from using find all references.
Nathan Stiles 16-Jan-12 13:31pm View
   
SAKryukov the number of calls will not change at runtime. I wanted to know before executing methodA how many individual references to methodB exist in methodA or how many references to methodB exist in the assembly. Not how many times methodB has been called, that's as you say a simple count.
The current solution would be to right click methodB in VS and find all references that gives me the count I'm looking for. I wanted to skip having to manually count references.
Nathan Stiles 16-Jan-12 13:23pm View
   
SAKryukov it could be either as far as I'm concerned.