Search

You searched for the word(s): userid:798762

Matching Posts

  • Re: LINQ/VB - Method 'Boolean IsUserInRole(System.String)' has no supported translation to SQL

    Unfortunately, it means what it says. You are using Linq to Sql and the parameter to the Where query has to be translated to sql. There is no translation of IsUserInRole to sql.
  • Re: algorithm to check duplicate in hireachy tree in C#

    What would make the newly added node a duplicate? Same qty and same updateddate? or same childid? or something else? Is this an sql question? Select * from bom_table where qty=@qty and updateddate = @updateddate or select * from bom_table where childid = @childid If not an sql question then can we see the classes you are using to store the tree and its nodes?
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: algorithm to check duplicate in hireachy tree in C#

    Do you mean that you cannot add a childid if it is already used as a parentid, that is the tree is always built from the root down? I am guessing that this is an sql problem even though you have posted in a c# forum. select * from bom_table where parentid = @childid; if there are no records returned then you are safe to insert.
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: algorithm to check duplicate in hireachy tree in C#

    can you show some sample data that may already exist in the table and give an example of a new row which is OK to insert and another new row which is not OK to insert? Something like this parented childID Null 1 1 2 1 3 Null 4 4 5 4 6 3 7
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: Date Conversion to mmm dd, yyyy

    The tricky bit is getting the ordinal for the day (5th, 21st, etc) as there is no support for this in the framework (that I can find). static string[] DayOrdinals = new string[]{ "", "1st","2nd","3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th"
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: Date Conversion to mmm dd, yyyy

    What type is the database column? Can you show the table definition? I suspect that it is some sort of string (varchar) rather than a datetime. The string in the database is probably in a different format from the one that the culture on your server expects and so when it trys to convert the string to a date it gets the month and day back to front. The best option would be to change the database column to be a Date rather than a string, but this may be a bigger change than you want to do.
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: Date Conversion to mmm dd, yyyy

    OK. Cast the result that comes from the database as a DateTime and then use string.Format. I don't know the VB but it is going to be very similar to the c# DateTime startDate = (DateTime)myReader.Item("Startdate"); EventStartDateLabel.Text = string.Format("From: {0:MMM d, yyyy}", startDate);
    Posted to C# (Forum) by Paul Linton on 11/27/2009
  • Re: generics questions

    "Make Roles Explicit" Create an interface called IName like this public interface IName { string Name {get; set;} } Then implement the interface in each of your classes by adding : IName to the end of the class signature class obj1 : IName { // as before } Now class gen can have its type parameter constrained like this class gen<T> where T : IName { public void Method<T>(T stype) { // Because c# knows that T implements the IName interface you // can just use the Name property
    Posted to C# (Forum) by Paul Linton on 11/25/2009
  • Re: How to iterate thru HashTable?

    If this is the correct code then you should be good to go with the corrections that I noted in my previous post. (PS I have to say, this is kind of weird code. You have a very complex key on your hashtable and then don't even use it for access. Are Master and Detail the only values? If so, why not just pass masterparamlist as one parameter and List<Dictionary<string, string>> as the details?)
    Posted to C# (Forum) by Paul Linton on 11/24/2009
  • Re: How to iterate thru HashTable?

    My code is just the same as your code, whatever problems your code has then mine will have the same. It was not proposed as a fix to your problem. Your screenshot answers the first question - the error is on the first foreach. The second question is also answered in the screenshot - insertTable is a Hashtable. I have never used Hashtable (I prefer the generic Dictionary<>) but the msdn documentation says that the loop variable in foreach for a Hashtable needs to be of type DictionaryEntry so
    Posted to C# (Forum) by Paul Linton on 11/24/2009
Page 1 of 82 (819 items) 1 2 3 4 5 Next > ... Last »