Search Results

Search found 13 results on 1 pages for 'stuffhappens'.

Page 1/1 | 1 

  • Can't launch asp.net mvc 2 application from iis 7.5

    - by StuffHappens
    Hello. I'm trying to launch my mvc 2 application from iis 7.5 and get HTTP 403.14 - Forbidden error. That's what I did: 1. Went to add or remove windows fitures checked iis, asp.net, http redirect. Installed all this stuff. 2. Launched Visual studio 2010 (release), created standart mvc 2 project and published it in default web site/ApplicationName 3. Set default DefaultAppPool .Net version to 4.0. I'm the only user of the computer and have admin rights. What might be wrong? Thank you for your help.

    Read the article

  • Handling exception from unmanaged dll in C#

    - by StuffHappens
    Hello. I have the following function written in C# public static string GetNominativeDeclension(string surnameNamePatronimic) { if(surnameNamePatronimic == null) throw new ArgumentNullException("surnameNamePatronimic"); IntPtr[] ptrs = null; try { ptrs = StringsToIntPtrArray(surnameNamePatronimic); int resultLen = MaxResultBufSize; int err = decGetNominativePadeg(ptrs[0], ptrs[1], ref resultLen); ThrowException(err); return IntPtrToString(ptrs, resultLen); } catch { return surnameNamePatronimic; } finally { FreeIntPtr(ptrs); } } Function decGetNominativePadeg is in unmanaged dll [DllImport("Padeg.dll", EntryPoint = "GetNominativePadeg")] private static extern Int32 decGetNominativePadeg(IntPtr surnameNamePatronimic, IntPtr result, ref Int32 resultLength); and throws an exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The catch that is in C# code doesn't actually catch it. Why? How to handle this exception? Thank you for your help!

    Read the article

  • Handling exception from unmanaged dll in C#

    - by StuffHappens
    Hello. I have the following function written in C# public static string GetNominativeDeclension(string surnameNamePatronimic) { if(surnameNamePatronimic == null) throw new ArgumentNullException("surnameNamePatronimic"); IntPtr[] ptrs = null; try { ptrs = StringsToIntPtrArray(surnameNamePatronimic); int resultLen = MaxResultBufSize; int err = decGetNominativePadeg(ptrs[0], ptrs[1], ref resultLen); ThrowException(err); return IntPtrToString(ptrs, resultLen); } catch { return surnameNamePatronimic; } finally { FreeIntPtr(ptrs); } } Function decGetNominativePadeg is in unmanaged dll [DllImport("Padeg.dll", EntryPoint = "GetNominativePadeg")] private static extern Int32 decGetNominativePadeg(IntPtr surnameNamePatronimic, IntPtr result, ref Int32 resultLength); and throws an exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The catch that is in C# code doesn't actually catch it. Why? How to handle this exception? Thank you for your help! UPDATED private static IntPtr[] StringsToIntPtrArray(params string[] strs) { IntPtr[] ptrs = new IntPtr[strs.Length + 1]; for(int i = 0; i < ptrs.Length - 1; i++) ptrs[i] = StringToIntPtr(strs[i]); ptrs[ptrs.Length - 1] = Marshal.AllocHGlobal(m_MaxResultStringBufSize); return ptrs; }

    Read the article

  • regex matches with intersection in C#

    - by StuffHappens
    Hello. I wonder if it is possible to get MatchCollection with all matches even if there's intersection among them. string input = "a a a"; Regex regex = new Regex("a a"); MatchCollection matches = regex.Matches(input); Console.WriteLine(matches.Count); This code return 1, but I want it to return 2. How do achive it? Thank you for your help.

    Read the article

  • Handling exception form unmanaged dll in C#

    - by StuffHappens
    Hello. I have the following function written in C# public static string GetNominativeDeclension(string surnameNamePatronimic) { if(surnameNamePatronimic == null) throw new ArgumentNullException("surnameNamePatronimic"); IntPtr[] ptrs = null; try { ptrs = StringsToIntPtrArray(surnameNamePatronimic); int resultLen = MaxResultBufSize; int err = decGetNominativePadeg(ptrs[0], ptrs[1], ref resultLen); ThrowException(err); return IntPtrToString(ptrs, resultLen); } catch { return surnameNamePatronimic; } finally { FreeIntPtr(ptrs); } } Function decGetNominativePadeg is in unmanaged dll [DllImport("Padeg.dll", EntryPoint = "GetNominativePadeg")] private static extern Int32 decGetNominativePadeg(IntPtr surnameNamePatronimic, IntPtr result, ref Int32 resultLength); and throws an exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The catch that is in C# code doesn't actually catch it. Why? How to handle this exception? Thank you for your help!

    Read the article

  • How to detect if a doc document password protected

    - by StuffHappens
    Hello. I have a folder with lots of doc-documents and I need to upload their context into database. The problem is that some of them are password protected and I don't know the password. I would like to skip them but I don't know how to detect if password protection presents. If someone helps I'll appriciate it greatly. P.S. Programming language is C#.

    Read the article

  • Why I can't use template table in dynamic query SQL SERVER 2005

    - by StuffHappens
    Hello! I have the following t-sql code which generates an error Declare @table TABLE ( ID1 int, ID2 int ) INSERT INTO @table values(1, 1); INSERT INTO @table values(2, 2); INSERT INTO @table values(3, 3); DECLARE @field varchar(50); SET @field = 'ID1' DECLARE @query varchar(MAX); SET @query = 'SELECT * FROM @table WHERE ' + @field + ' = 1' EXEC (@query) The error is Must declare the table variable "@table". What's wrong with the query. How to fix it?

    Read the article

  • where to store temporary data in MVC 2.0 project

    - by StuffHappens
    Hello! I'm starting to learn MVC 2.0 and I'm trying to create a site with a quiz: user is asked a question and given several options of answer. If he chooses the right answer he gets some points, if he doesn't, he looses them. I tried to do this the following way public class HomeController : Controller { private ITaskGenerator taskGenerator = new TaskGenerator(); private string correctAnswer; public ActionResult Index() { var task = taskGenerator .GenerateTask(); ViewData["Task"] = task.Task; ViewData["Options"] = task.Options; correctAnswer= task.CorrectAnswer; return View(); } public ActionResult Answer(string id) { if (id == correctAnswer) return View("Correct") return View("Incorrect"); } } But I have a problem: when user answers the cotroller class is recreated and I loose correct answer. So what is the best place to store correct answer? Should I create a static class for this purpose? Thanks for your help!

    Read the article

  • LINQ to SQL auto-generated type for stored procedure

    - by StuffHappens
    Hello. I have the following stored procedure ALTER PROCEDURE [dbo].Test AS BEGIN CREATE TABLE ##table ( ID1 int, ID2 int ) DECLARE @query varchar(MAX); INSERT INTO ##table VALUES(1, 1); SELECT * FROM ##table; END And I try to use it from C# code. I use LINQ to SQL as an O/RM. When I add the procedure to DataBaseContext it says that it can't figure out the return value of this procedure. How to modify the stored procedure so that I can use it with LINQ to SQL. Note: I need to have global template table!

    Read the article

  • execute stored procedure as another user premission

    - by StuffHappens
    Hello. I faced the following problem: there's a user who has to execute a stored porcedure (spTest). In spTest's body sp_trace_generateevent is called. sp_trace_generateevent requires alter trace permissions and I don't want user to have it. So I would like user to be able to execute spTest. How can I do that? Thank you for your help.

    Read the article

  • Getting a Type variable knowing the name of type C#

    - by StuffHappens
    Hello! I'm developing a TypeTranslator class which has a method Type TranslateType(Type type). This method gets a type of an interface and if there's a class of interface name without leading I it creates it, otherwise an exception is raised. Here's some code to clearify what's written before: class Program { interface IAnimal { } class Animal : IAnimal { } void Function() { TypeTranslator typeTranslator = new TypeTranslator(); Assert(typeTranslator.TranslateType(typeof(IAnimal) == typeof(Animal))); } } Is it possible to get what I want? Thank you for your help!

    Read the article

1