Search Results

Search found 14 results on 1 pages for 'kettenbach'.

Page 1/1 | 1 

  • How do I start a second console application in Visual Studio when one is already running

    - by Kettenbach
    Hi All, I am working through some examples in a WCF book. There is a Host project and Client project within a single solution. Both are console applications. The Host is the startup app, but the Client app doesn't seem to open the Console like the book says. Book says while the Host is running, run the Client. The Run button is disabled tho as it is already running. The book example definitely has them in the same solution and a single instance of Visual Studio. Anyways, what am I missing here? I have done this with two instances of VS, but I truly have never does this in a single instance. Any help is always appreciated. Cheers, ~ck in San Diego

    Read the article

  • Linq help using "Contains"

    - by Kettenbach
    Good Morning All, I'm trying to use "Contains" to see if an object is within the collection. When I break I can see that the object is indeed part of the collection however "Contains" seems to be returning false indicating the item is not in the collection. Any idea what I'm doing wrong? if(HttpContext.Current.Session["AutoPayTypes"] != null) { var autopays = HttpContext.Current.Session["AutoPayTypes"] as List<PaymentTypeInfo>; char? coverageProductLine = null; if(entityProps.ContainsKey("CoverageProductLine")) { coverageProductLine = (char?)entityProps["CoverageProductLine"]; } var paymentTypeInfoRepository = new PaymentTypeInfoRepository(); var payType = paymentTypeInfoRepository.GetPaymentTypeInfo(paymentAdd.PayType, coverageProductLine); if (autopays != null && payType != null) paymentAdd.DaysPaid = autopays.Contains(payType) ? null : paymentAdd.DaysPaid; } If the object is not in the collection the "DaysPaid" needs to be null. Any ideas? Thanks, ~ck in San Diego

    Read the article

  • How can I update multiple columns with a Replace in SQL server?

    - by Kettenbach
    How do I update different columns and rows across a table? I want to do something similiar to replace a string in SQL server I want to do this but the value exists in multiple columns of the same type. The values are foreign keys varchars to an employee table. Each column represents a task, so the same employee may be assigned to several tasks in a record and those tasks will vary between records. How can I do this effectively? Basically something of a replace all accross varying columns throughout a table. Thanks for any help or advice. Cheers, ~ck in San Diego

    Read the article

  • Javascript help - compare two dates in (dd/MMM/yyyy) format

    - by Kettenbach
    Hi All, I am trying to compare to textbox values on an aspx form. Both the values represent dates. The are formatted like "dd/MMM/yyyy". How can I compare them in javascript to see if they are not equal and which one is greater etc... Does javascript have a date constructor for strings like this? Any tips would be appreciated. Thanks for the help. Cheers, ~ck in San Diego

    Read the article

  • ObjectDataSource DataObjectTypeName Help. Pass object as parameter

    - by Kettenbach
    I have a partial class (the main class is a LinqToSql generated class) <DataObject(True)> _ Partial Public Class MBI_Contract <DataObjectMethod(DataObjectMethodType.Select, True)> _ Public Shared Function GetCancelableContracts(ByVal dealer As Dealer) As List(Of MBI_Contract) Return Utilities.GetCancelableContractsForDealer(dealer) End Function End Class Here is the method it's calling Public Function GetCancelableContractsForDealer(ByVal dealer As Dealer) As List(Of MBI_Contract) Dim db As TestDataContext = TestDataContext.Create() Return (From mbi As MBI_Contract In db.MBI_Contracts _ Where mbi.MBI_DealerNumber = dealer.DealerNumber _ AndAlso mbi.MBI_PaidFor = True _ AndAlso mbi.MBI_Deleted = False).ToList() End Function I want to use the ObjectDataSource to drive a DropDownList. <asp:ObjectDataSource ID="contractOds" runat="server" TypeName="MBI_Contract" SelectMethod="GetCancelableContracts" DataObjectTypeName="Dealer"> </asp:ObjectDataSource> My aspx page has a Dealer property that is set in a BasePage. My question is how can I pass this property(object) to the ObjectDataSource, so it can be evaluated in my select method. Does anyone know how I can do this? Or am I totally doing this the wrong way? Thanks for any Advice, Cheers, ~ck in San Diego

    Read the article

  • Javascript help - compare two dates in Euro (dd/MMM/yyyy) format

    - by Kettenbach
    Hi All, I am trying to compare to textbox values on an aspx form. Both the values represent dates. The are formatted like "dd/MMM/yyyy". How can I compare them in javascript to see if they are not equal and which one is greater etc... Does javascript have a date constructor for strings like this? Any tips would be appreciated. Thanks for the help. Cheers, ~ck in San Diego

    Read the article

  • WCF Ajax service - How can I pass an Array or JSON to the service? What should the method parameter

    - by Kettenbach
    I have a very simple WCF service I would like to pass it an array or json? [OperationContract, WebGet(ResponseFormat = WebMessageFormat.Json)] public string GetPreDisplay(string inputData) { //DoSomething with inputData return "Sweet!"; } My javascript... var data = [paymentControls['claimNum'], paymentControls['claimSeq']]; $lps.GetPreDisplay(data, onComplete); Obviously string is the wrong type. Can anyone point me in the right direction? Thanks, ~ck

    Read the article

  • LinqToXML why does my object go out of scope? Also should I be doing a group by?

    - by Kettenbach
    Hello All, I have an IEnumerable<someClass>. I need to transform it into XML. There is a property called 'ZoneId'. I need to write some XML based on this property, then I need some decendent elements that provide data relevant to the ZoneId. I know I need some type of grouping. Here's what I have attempted thus far without much success. **inventory is an IEnumerable<someClass>. So I query inventory for unique zones. This works ok. var zones = inventory.Select(c => new { ZoneID = c.ZoneId , ZoneName = c.ZoneName , Direction = c.Direction }).Distinct(); No I want to create xml based on zones and place. ***place is a property of 'someClass'. var xml = new XElement("MSG_StationInventoryList" , new XElement("StationInventory" , zones.Select(station => new XElement("station-id", station.ZoneID) , new XElement("station-name", station.ZoneName)))); This does not compile as "station" is out of scope when I try to add the "station-name" element. However is I remove the paren after 'ZoneId', station is in scope and I retreive the station-name. Only problem is the element is then a decendant of 'station-id'. This is not the desired output. They should be siblings. What am I doing wrong? Lastly after the "station-name" element, I will need another complex type which is a collection. Call it "places'. It will have child elements called "place". its data will come from the IEnumerable and I will only want "places" that have the "ZoneId" for the current zone. Can anyone point me in the right direction? Is it a mistake select distinct zones from the original IEnumerable? This object has all the data I need within it. I just need to make it heirarchical. Thanks for any pointers all. Cheers, Chris in San Diego

    Read the article

  • jQuery selector help - Can I generate a selector from clicking on an element?

    - by Kettenbach
    Hi All, I have jQuery, FireFox, Firebug, IE, and IE developer toolbar. When I am examing a page with either FireBug or IE Dev toolbar, I am able to click on an element and it shows me in the dom where the element is etc... Is there anyway to transform that selection into a valid jQuery selector? I know I can use ID, classes, and element relative to other elements etc... but what about when I am looking at some random table cell that doesn't have a class or id etc.. Can I generate a selector on the fly like that? I thought for sure there was. Any thoughts or ideas are always appreciated Thanks, ~ck in San Diego

    Read the article

  • Can/Should you throw exceptions in a c# switch statement?

    - by Kettenbach
    Hi All, I have an insert query that returns an int. Based on that int I may wish to throw an exception. Is this appropriate to do within a switch statement? switch (result) { case D_USER_NOT_FOUND: throw new ClientException(string.Format("D User Name: {0} , was not found.", dTbx.Text)); case C_USER_NOT_FOUND: throw new ClientException(string.Format("C User Name: {0} , was not found.", cTbx.Text)); case D_USER_ALREADY_MAPPED: throw new ClientException(string.Format("D User Name: {0} , is already mapped.", dTbx.Text)); case C_USER_ALREADY_MAPPED: throw new ClientException(string.Format("C User Name: {0} , is already mapped.", cTbx.Text)); default: break; } I normally add break statements to switches but they will not be hit. Is this a bad design? Please share any opinions/suggestions with me. Thanks, ~ck in San Diego

    Read the article

  • ClassCleanup in MSTest is static, but the build server uses nunit to run the unit tests. How can i a

    - by Kettenbach
    Hi All, MSTest has a [ClassCleanup()] attribute, which needs to be static as far as I can tell. I like to run through after my unit tests have run,and clean up my database. This all works great, however when I go to our build server and use our Nant build script, it seems like the unit tests are run with NUnit. NUnit doesn't seem to like the cleanup method to be static. It therefore ignores my tests in that class. What can I do to remedy this? I prefer to not use [TestCleanUp()] as that is run after each test. Does anyone have any suggestions? I know [TestCleanup()] aids in decoupling, but I really prefer the [ClassCleanup()] in this situation. Here is some example code. ////Use ClassCleanup to run code after all tests have run [ClassCleanup()] public static void MyFacadeTestCleanup() { UpdateCleanup(); } private static void UpdateCleanup() { DbCommand dbCommand; Database db; try { db = DatabaseFactory.CreateDatabase(TestConstants.DB_NAME); int rowsAffected; dbCommand = db.GetSqlStringCommand("DELETE FROM tblA WHERE biID=@biID"); db.AddInParameter(dbCommand, "biID", DbType.Int64, biToDelete); rowsAffected = db.ExecuteNonQuery(dbCommand); Debug.WriteLineIf(rowsAffected == TestConstants.ONE_ROW, string.Format("biId '{0}' was successfully deleted.", biToDelete)); } catch (SqlException ex) { } finally { dbCommand = null; db = null; biDelete = 0; } } Thanks for any pointers and yes i realize I'm not catching anything. I need to get passed this hurdle first. Cheers, ~ck in San Diego

    Read the article

  • SQL help - find the table that has 'somefieldId' as the primary key?

    - by Kettenbach
    Hello All, How can I search my sql database for a table that contains a field 'tiEntityId'. This field is referenced in a stored procedure, but I am unable to identify which table this id is a primary key for? Any suggestions? I currently look through stored procedure definitions for references to text by using something like this Declare @Search varchar(255) SET @Search='[10.10.100.50]' SELECT DISTINCT o.name AS Object_Name,o.type_desc FROM sys.sql_modules m INNER JOIN sys.objects o ON m.object_id=o.object_id WHERE m.definition Like '%'+@Search+'%' ORDER BY 2,1 Any SQL guru's out there know what I need to use to find the table that contains the field, 'preferably the table where that field is the Primary Key. Thanks so much for any tips. Cheers, ~ck in San Diego

    Read the article

  • Extension method question. Why do I need to use someObj = someObj.somemethod();

    - by Kettenbach
    Hi All, I have a simple extension method that I would like to use to add an item to an array of items. public static T[] addElement<T>(this T[] array, T elementToAdd) { var list = new List<T>(array) {elementToAdd}; return list.ToArray(); } this works ok, but when I use it, I am having to set the array equal to the return value. I see that I am returning an Array. I likely want this method to be void, but I would like the item added. Does anyone have any ideas on what I need to do , to make this work the way I am wanting? Instead of someArray = someArray.addElement(item), I just want to do someArray.addElement(item) and then someArray be ready to go. What am I missing here? Thanks, ~ck in San Diego

    Read the article

  • SQL IF ELSE with output params stored proc help

    - by Kettenbach
    Hi All, I have a stored proc (SS2008) that takes a couple int ids and needs to look up if they exist in a table before adding a record. I have an int output param I would like to return and set its value based on what occrured. I have this so far, but it always returns 1. Can someone point me in the right direction? BEGIN TRY IF EXISTS ( SELECT * FROM tbMap WHERE (cId= @CId) ) SET @result = -1; -- This C User is already mapped ELSE IF EXISTS ( SELECT * FROM tbMap WHERE (dId = @DId) ) SET @result = -2; -- This D User is already mapped ELSE INSERT INTO tbMap ( Login , Email , UserName , CId , DId) SELECT @UserName , usr.EmailAddress , usr.UserName , @CId , @DId FROM tbUser usr WHERE usr.iUserID = @DId SET @result = 1; RETURN END TRY What am I missing? Thanks for any tips. Cheers, ~ck in San Diego

    Read the article

1