이름은 상관 없으나 확장자가 udl인 text 파일을 한 개 만든다.
더블 클릭하면 아래와 같은 그림이 나온다.

image 

DB관련 정보를 넣고 만든 파일을 노트패드로 연다.

image

DB 접속 String을 다음과 같이 얻을 수 있다.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/06 21:43 2009/10/06 21:43
오유를 가보면 더블 클릭으로 맨 위 혹은 맨 아래로 움직일수 있다. 하지만 IE 7 부터인지 영 맨 아래로는 가는데 맨 위로는 가질 않는다. 알구 봤더니. document.body.scrollTop 을 document.documentElement.scrollTop으로 바꿔 주니까 해결이 된다.

적용전
<script language=javascript>
function totopbottom() {
    if (document.body.scrollTop == 0) { 
        window.scrollTo(0,document.body.scrollHeight);
    } else {
        window.scrollTo(0,0);
    }
}

function topbottom() {
    document.body.ondblclick = totopbottom;
}</script>

적용후
<script language=javascript>
function totopbottom() {
    if (document.documentElement.scrollTop == 0) { 
        window.scrollTo(0,document.body.scrollHeight);
    } else {
        window.scrollTo(0,0);
    }
}

function topbottom() {
    document.body.ondblclick = totopbottom;
}</script>
별도로 맨아래에 넣어야 하는 코드
<script>topbottom()</script>
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/06 02:28 2009/10/06 02:28
#region Using directives

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Windows.Forms;

#endregion

namespace UsingADOManagedProvider
{
   partial class ADONetForm1 : Form
   {
      public ADONetForm1( )
      {
         InitializeComponent( );
         // connect to Northwind Access database
         string connectionString = "Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.XXX )(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = GROUP))); User Id =; Password =";

         // get records from the customers table
         string commandString = "Select CompanyName, ContactName from Customers";

         // create the data set command object 
         // and the DataSet

         OleDbDataAdapter DataAdapter = new OleDbDataAdapter( commandString, connectionString );

         DataSet DataSet = new DataSet( );

         // fill the data set object
         DataAdapter.Fill( DataSet, "Customers" );

         // Get the one table from the DataSet
         DataTable dataTable = DataSet.Tables[0];

         // for each row in the table, display the info
         foreach ( DataRow dataRow in dataTable.Rows )
         {
            lbCustomers.Items.Add( dataRow["CompanyName"] + " (" + dataRow["ContactName"] + ")" );
         }
      }
   }
}
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/06 01:52 2009/10/06 01:52