16 Kasım 2015 Pazartesi

JSCRIPT .NET

import System;
import System.ServiceProcess;
import System.Diagnostics;
import System.Timers;

class SimpleService extends ServiceBase
{
   private var timer : Timer;

   // Constructor -- setup the service properties
   function SimpleService()
   {
      CanPauseAndContinue = true;
      ServiceName = "JScript Service";

      timer = new Timer();
      timer.Interval = 1000;
      timer.AddOnTimer(OnTimer);
   }

eba combobox

eba tek seçimli liste grid özelliği kullanılmadığı zaman web formundaki DropDownList kontrolü gibi çalışır. Integration manager yerine codebehid tarafından bu kontrolü doldurmak için bir kaç yol var. System.Web.UI.WebControls  kütüphanesi  eklendikten sonra DropDownList kontrolünü kullanabilirsiniz.

Bunlardan ikisini yazıyorum:

Yol 1:



 SqlConnection cnn = null;
 SqlCommand cmd = new SqlCommand("SELECT *****", cnn);

 cmd.Connection.Open();

 SqlDataReader ddlValues;
 ddlValues = cmd.ExecuteReader();

 DropDownList list = new DropDownList();
           
            while (  ddlValues.Read()   )
            {
                list.Items.Add(new ListItem("Text1","Value1"));

            }



Yol 2: 1 dekine benzer. Burada bind ederek kullanabiliyoruz.

DropDownList list = new DropDownList();

 SqlConnection cnn = null;
 SqlCommand cmd = new SqlCommand("SELECT *****", cnn);

 cmd.Connection.Open();

 SqlDataReader ddlValues;
 ddlValues = cmd.ExecuteReader();


 list.DataTextField ="Field1";
 list.DataValueField ="Field2";
 list.DataSource =ddlValues;

 list.DataBind();

           
          




evren pehlivan yazılım

evren pehlivan yazılım, evren pehlivan yazılım geliştirici