Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Patrik karlin

@Patrik karlin
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • google search engine api using c#
    P Patrik karlin

    Hej google has an ajax api att http://code.google.com/apis/ajax/playground/ There lots of example for searsh att this site. If you dont like javascript there's probelby a way to get this with the .net WebClient Class # Edit : ops from a windows application then add a reference to System.Net And write this function static string search(string what) { var x = new WebClient(); var q = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" + what.Replace(" " , "%20"); var uri = new Uri(q); var downloaded = x.DownloadString(q); return downloaded; } and you whill get json formated like this {"responseData": {"results":[{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://sv.wikipedia.org/wiki/Patrik","url":"http://sv.wikipedia.org/wiki/Patrik","visibleUrl":"sv.wikipedia.org","cacheUrl":"http://www.google.com/search?q\u003dcache:55ZSvMNvIkIJ:sv.wikipedia.org","title":"\u003cb\u003ePatrik\u003c/b\u003e - Wikipedia","titleNoFormatting":"Patrik - Wikipedia","content":"Mansnamnet \u003cb\u003ePatrik\u003c/b\u003e, Patric eller Patrick är av skotskt ursprung och kom till Sverige på 1600-talet med invandrande skotska släkter. \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://griskindspatrik.wordpress.com/","url":"http://griskindspatrik.wordpress.com/","visibleUrl":"griskindspatrik.wordpress.com","cacheUrl":"http://www.google.com/search?q\u003dcache:pM9u03q_o30J:griskindspatrik.wordpress.com","title":"\u003cb\u003ePatrik\u003c/b\u003e","titleNoFormatting":"Patrik","content":"Absolut inte hemgjort, för det var den för ”vispad” (Veronica) och för finfördelad (\u003cb\u003ePatrik\u003c/b\u003e). Nu har jag ju inte tillverkat ankrillettes själv (ÄN, \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://www.imdb.com/title/tt1067733/","url":"http://www.imdb.com/title/tt1067733/","visibleUrl":"www.imdb.com","cacheUrl":"http://www.google.com/search?q\u003dcache:OQsxMHBWufkJ:www.imdb.com","title":"\u003cb\u003ePatrik\u003c/b\u003e 1,5 (2008)","titleNoFormatting":"Patrik 1,5 (2008)","content":"Directed by Ella Lemhagen. With Gustaf Skarsgård, Torkel Petersson, Thomas Ljungman. A Swedish gay couple adopt what they think is a 15-month-old orphan, \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://www.patrikschumacher.com/","

    C# csharp json

  • retreiving values from datatable
    P Patrik karlin

    1. if your using .net 3.5 then use linq to sql here -> http://www.asp.net/learn/linq-videos/ 2. why are you checking wherewer the strQueryString is null or nott why whuld that mather your outputting to dtTableRecords_out the first element of objDataSet.Tables[0] isent that what your going for.

    C# database csharp sales tutorial

  • Passing a Method to a second form
    P Patrik karlin

    DaveyM69 wrote:

    ... but now you're starting to couple unrelated classes - not a great idea. The easiest, sure - but best avoided.

    .... Yea Sure .. maybe the logic should be in the model.... form1 can subscribe to a datachanged event and form2 youst update's the data in the model... then they whill be completle seperated.

    C# help

  • Passing a Method to a second form
    P Patrik karlin

    Hej bwood2020 You Migth whant to use a static resource that can laungh that form1 passes an event to

    static class EventHandler
    {
    static Action Event; // the global state
    public static void SetGlobalEvent(Action a) // Setts the event
    {
    Event = a;
    }
    public static void Execute_Event() // Execute the event
    {
    Event();
    }

    }
    
    class Form1
    {
        public Form1()
        {
            EventHandler.SetGlobalEvent(Event); // Sett the event
        }
    
        public void Event() // The events that going to be executet
        {
            var x = 2 + 2;
        }
    }
    
    class Form2
    {
        public void Onclick()
        {
            EventHandler.Execute\_Event(); // Execute the event
            this.Destroy(); // Destroy your form ( or close )
        }
    }
    

    There migth be a bether way of doing this if form1 creates form2 you can pass in "this" from form1 as a parameter that way form2 whill be able to call the method on that object Hopes this helps Patrik

    C# help

  • Polymorphism Questions with EntityFramework
    P Patrik karlin

    Hej Juvil John As i se it custum1 is first set as a CustomClass1 object and is given a new reference to it. The you move the reference to baseclass witch is a class1 object. Butt here comes the strange thing you show this baseclass = ( LINQ to EDM Query).First(); Witch should render the first code meaningless since the reference to the CustomClass1 is now gone and replaced whit the first object of the query ( witch i don't now the type of butt i am assuming its a class1 since your not casting it). So then you cant cast it back because the object its now referenced to is of the wrong type. If i gott it rigth then tell me what your trying to accomplish by this( Adding methods tho the type ?? ) Becuse then there is other ways of doing it.

    LINQ question csharp database linq oop

  • Genreics
    P Patrik karlin

    Hej i am writing a abstract class with a method that takes an expression parameter to point to a field.... The field it self is not present in this base class so the the expression needs to use the subclass so i need to have that type present in the method definition and the current way i am doing this is..

    abstract class foo<SubClass>
    {
    public void bar(Expression <Func<SubClass , object >> Expression);
    }

    As you see i need to pass in the subclass type from the subclass to the base class witch is not ideal since i am not going to be writing the subclass so my question is how can i use the type of the subclass without passing it as a parameter. Thanks for answers in advance .. Patrik

    C# question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups