오라클 엔티티 기초 쿼리방법 

 

using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data;
using System.Data.EntityClient;
using System.Data.Objects;

namespace EntityFramework
{
    class Program
    {
        static void Main(string[] args)
        {
            using (HREntities ctx = new HREntities())
            {
                int max_id = 102;

                // LINQ to Entities query -- Retrieve employees with ID number less than max_id
                var OraLINQ1 = from e in ctx.EMPLOYEES
                               where e.EMPLOYEE_ID < max_id
                               select e;

                Console.WriteLine("LINQ to Entities Result");
                foreach (var result in OraLINQ1)
                {
                    Console.WriteLine("ID: " + result.EMPLOYEE_ID +
                        "    Name: " + result.FIRST_NAME +
                        "    Salary: " + result.SALARY);
                }

                Console.WriteLine();
                Console.ReadLine();


                // LINQ using lambda expressions -- Select employees with ID number less than max_id
                // Then increase salary using stored procedure mapping
                var OraLINQ2 = ctx.EMPLOYEES.Where<EMPLOYEE>(emp => emp.EMPLOYEE_ID < max_id);

                foreach (var result in OraLINQ2)
                    result.SALARY = 18000;

                ctx.SaveChanges();

                Console.WriteLine("Salaries Updated");
                Console.WriteLine();
                Console.ReadLine();


                 //Entity SQL  -- Retrieve employees with ID number less than max_id
                string esql = "select e.EMPLOYEE_ID, e.FIRST_NAME, e.SALARY from HREntities.EMPLOYEEs as e where e.EMPLOYEE_ID < " + max_id;
                EntityConnection econn = new EntityConnection("name=HREntities");

                econn.Open();
                EntityCommand ecmd = econn.CreateCommand();
                ecmd.CommandText = esql;
                EntityDataReader ereader = ecmd.ExecuteReader(CommandBehavior.SequentialAccess);

                Console.WriteLine("Entity SQL Result");
                while (ereader.Read())
                {
                    Console.WriteLine("ID: " + ereader.GetValue(0) +
                        "    Name: " + ereader.GetValue(1) +
                        "    Salary: " + ereader.GetValue(2));
                }
                Console.WriteLine();
                Console.ReadLine();


                int id = 100;
                int salary = 24000;

                foreach (var result in ctx.UPDATE_AND_RETURN_SALARY(id, salary))
                {
                    Console.WriteLine("Name: " + result.FIRST_NAME + "  Updated Salary: " + result.SALARY);
                }

                Console.WriteLine();
                Console.ReadLine();

          // // Return an output parameter from a stored procedure
                ObjectParameter outparam = new ObjectParameter("outp", typeof(string));

                ctx.OUTPARAM(outparam);
                Console.WriteLine(outparam.Value);
              
                Console.WriteLine();
                Console.ReadLine();


                 //Create new department entry
                var OraLINQ3 = new DEPARTMENT() { DEPARTMENT_ID = 280, DEPARTMENT_NAME = "Research" };
                ctx.DEPARTMENTS.AddObject(OraLINQ3);
                ctx.SaveChanges();

                Console.WriteLine("New department added");

                 //Verify the new department exists
                var OraLINQ4 = from d in ctx.DEPARTMENTS
                                where d.DEPARTMENT_ID == 280
                                 select d.DEPARTMENT_NAME;

                Console.WriteLine("Department Name: " + OraLINQ4.First());
               Console.ReadLine();

                 //Delete new department entry
                ctx.DeleteObject(OraLINQ3);
                ctx.SaveChanges();
                Console.WriteLine("New department removed?");

                //Verify the department was removed
                if (OraLINQ4.FirstOrDefault() == null)
                    Console.WriteLine("Yes, it was removed.");
                else
                    Console.WriteLine("No, it was not removed.  Department Name: " + OraLINQ4.First());

                Console.ReadLine();
            }
        }
    }
}

 

출처는 모르겠습니다 ㅜ_ㅜ  지송

 

3717163436_RhjIBJ1P_1330481294125_1

c# 에서 구글맵,빙맵등을 간편하게 사용 할 수 있게 해주는 컴퍼넌트

http://greatmaps.codeplex.com/

 

GMap.NET is great and Powerful, Free, cross platform, open source .NET control. Enable use routing, geocoding, directions and maps from Coogle, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yandex, Mapy.cz, Maps.lt, iKarte.lv, NearMap, OviMap, CloudMade, WikiMapia in Windows Forms & Presentation, supports caching and runs on windows mobile!

Preview:

  • gmap1512.png

The Greatest maps in the world:

 

http://msdn.microsoft.com/ko-kr/library/76dt1k3h.aspx

WCF 디버깅 방법

http://blogs.msdn.com/b/carlosfigueira/archive/2011/08/02/wcf-extensibility-system-diagnostic-tracing.aspx

 

 

 

위에 설명된 내용을  WCF 서비스 구성 편집기에 들어가면 간단하게 설정 할 수 있습니다.

image

 

 

image

 

image

 

다운로드 URL: http://ifunboxmac.com/

 

iFunBox for Mac: First Release
iFunBox for Mac is an App/File Manager for iPhone, iPad and iPod Touch. Current features include:

  • App installation
  • Super fast file transfer with drag-and-drop between Mac and your iOS device
  • Thumbnail preview for image files
  • Task manager for multiple file transfers
All the features of iFunBox for Windows will be implemented in iFunBox for Mac, including system/user app view, app backup, music management... will be introduced in future versions. Find us at Facebook, Twitter or email us at ifunbox.mac@gmail.com

온라인 상에서 바로 테스트를 할 수 있습니다.

http://www.gskinner.com/RegExr/

image

아래에다가 정규식을 입력하고 global을 체크하시면 실시간으로 확인 가능합니다.

image

영어/한글/숫자만 입력 받게 되있는 정규식이므로  나머지는 다 체크가 뜨고 있습니다.

image

 

간단하게 쓸 수 있는 예제도 있습니다.

image

NET Framework 4만 사용됨

 

동적으로 프로퍼티를 추가삭제할 일이생겼는데  ExpandoObject따위가 있음

 

dynamic

http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=KO-KR&k=k(DYNAMIC_CSHARPKEYWORD);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22);k(DevLang-CSHARP)&rd=true

 

dynamic 형식을 사용하면 컴파일 타임 형식 검사를 무시하는 작업을 수행할 수 있습니다.대신, 이러한 작업은 런타임에 확인됩니다.dynamic 형식은 Office Automation API와 같은 COM API, IronPython 라이브러리와 같은 동적 API 및 HTML DOM(문서 개체 모델)에 대한 액세스를 간소화합니다.

형식 dynamic은 대부분의 환경에서 형식 object 같이 동작합니다.그러나 형식 dynamic의 식이 포함된 작업은 컴파일러에서 형식이 확인되지 않습니다.컴파일러는 작업에 대한 정보를 함께 패키지하고 해당 정보는 나중에 런타임에서 작업을 평가하는 데 사용됩니다.프로세스의 일부로 변수 형식 dynamic이 object 형식 변수에 컴파일됩니다.따라서 형식 dynamic은 런타임이 아닌 컴파일 타임에만 존재합니다.

 

ExpandoObject 클래스로 런타임에 그 클래스의 인스턴스 멤버들을 추가 및 삭제할 수 있으며, 이 멤버들의 값을 설정하고 가져올 수도 있습니다.이 클래스는 sampleObject.GetAttribute("sampleMember") 와 같이 더 복잡한 구문 대신 sampleObject.sampleMember와 같은 표준 구문을 사용할 수 있게 해주는 동적 바인딩을 지원합니다.

 

ExpandoObject 클래스

http://msdn.microsoft.com/ko-kr/library/dd487338.aspx

런타임에 동적으로 추가 및 제거할 수 있는 멤버가 있는 개체를 나타냅니다.

 

 

인스턴스 만들기

C# 에서 ExpandoObject 클래스의 인스턴스에 런타임에 바인딩을 사용하려면 반드시 dynamic 키워드를 사용해야 합니다.자세한 내용은 dynamic 형식 사용(C# 프로그래밍 가이드)을 참조하십시오.

 

아래에 보면 Name 과 Age라는 프로퍼티를 임의로 생성하고 있다. 오류안남 ㅋ

image

 

ExpandoObject 를 바인딩해보자!

image

 

실행된 화면

image

INotifyPropertyChanged 먹는다!!

// Add "using System.ComponentModel;" line 
// to the beginning of the file.
class Program
{
    static void Test()
    {
        dynamic employee = new ExpandoObject();
        ((INotifyPropertyChanged)employee).PropertyChanged +=
            new PropertyChangedEventHandler(HandlePropertyChanges);
        employee.Name = "John Smith";
    }

    private static void HandlePropertyChanges(
        object sender, PropertyChangedEventArgs e)
    {
        Console.WriteLine("{0} has changed.", e.PropertyName);
    }
}

 

 

추가로 프로퍼티도 임의로 넣기

        void Window1_Loaded(object sender, RoutedEventArgs e)
        {

            List<ExpandoObject> expand = new List<ExpandoObject>();

            for (int i = 0; i < 10; i++)
            {
                dynamic sampleObject = new ExpandoObject();
                var p = sampleObject as IDictionary<String, object>;
                p["Name"] = "kojaedoo";
                p["Age"] = i;
                if (i == 9)
                {
                    p["CreateDate"] = "kojaedoo";
                }
                expand.Add(sampleObject);
                
            }

            this.dataGrid1.ItemsSource = expand;
        }


        private void button1_Click(object sender, RoutedEventArgs e)
        {
            var result = this.dataGrid1.SelectedItem as IDictionary<String, object>;
            if (result != null)
            {
               string s = result["Name"].ToString(); //kojaedoo           

            }
        }
http://www.howtogetviews.com/download-youtube-videos-free/


FastestTbue 를 사용하면 사파리에서 유투브 동영상을 다운로드 할수있습니다.
 

FastestTube

YouTube downloader tool 









설치도 간단합니다.


브라우저에 맞게 다운로드합니다.

설치하고 나서 http://www.youtube.com/  접속하고 다운받고 싶은 동영상을 클릭하면 
 

다운로드메뉴가 새로 생겼습니다.
 




업로드된 동영상에 따라 HD급도 다운로드 가능합니다.




 끗~
http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/

폼안에 파라메터를 한번에 전송 할 수 있다.
$(function(){
    $("#JqAjaxForm").submit(function(e){
       e.preventDefault();

        dataString = $("#JqAjaxForm").serialize();

        $.ajax({
        type: "POST",
        url: "process_form.aspx",
        data: dataString,
        dataType: "json",
        success: function(data) {

            if(data.email_check == "invalid"){
                $("#message_ajax").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
            } else {
                $("#message_ajax").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
            }

        }

        });          

    }); 
}); 
-----------------------------------
멀티파라메터롤 전송할수 있다. 

$.ajax({

type: "POST",

url: "process_Form.aspx",

data: "name=kojaedoo&location=busan",

success: function(msg){

alert( "Data : " + msg );

}

});


<Form name="JqAjaxForm">
<input type=hidden name=it_id value='<?=$it[it_id]?>'>
<input type=hidden name=it_name value='<?=$it[it_name]?>'>
<input type=hidden name=ca_id value='<?=$it[ca_id]?>'>
<input type=hidden name=sw_direct>
<input type=hidden name=url>
</form> 

+ Recent posts