1. 26.
    0
    UPDULLAH
    ···
  2. 25.
    0
    1 HttpWebRequest class'i
    2 MySQL Connector/Net
    3 uzun is
    4 http://msdn.microsoft.com...nection%28v=vs.71%29.aspx

    public void InsertRow(string myConnectionString)
    {
    // If the connection string is null, use a default.
    if(myConnectionString == "")
    {
    myConnectionString = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;" +
    "Integrated Security=SSPI;";
    }
    OleDbConnection myConnection = new OleDbConnection(myConnectionString);
    string myInsertQuery = "INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')";
    OleDbCommand myCommand = new OleDbCommand(myInsertQuery);
    myCommand.Connection = myConnection;
    myConnection.Open();
    myCommand.ExecuteNonQuery();
    myCommand.Connection.Close();
    }
    ···
  3. 24.
    0
    @23 o ney lan
    ···
  4. 23.
    0
    python soruyosan sor
    ···
  5. 22.
    0
    yok mu daha cevap beyler
    ···
  6. 21.
    0
    yok mu daha cevap beyler
    ···
  7. 20.
    0
    @17 panpa cevap bu kadar uzun olamaz sınav yazılı olucak, hocanın verdigi sorular bunlar
    ···
  8. 19.
    +1
    şarap sanıp geldim. sürekli içerim tek lsun arkadaşlarla olsun. severim şarabı ama anlamam en ucuzunu alırım sürekli. o kadar yani
    ···
  9. 18.
    0
    @17 adamın kafası amcıkladı o nasıl kod öyle gibtin duvarı
    ···
  10. 17.
    0
    private void getCamList()
    {
    try
    {
    videoDevices = new FilterInfoCollection(FilterCategory. VideoInputDevice);
    comboBox1.Items. Clear();
    if (videoDevices. Count == 0)
    throw new ApplicationException();

    DeviceExist = true;
    foreach (FilterInfo device in videoDevices)
    {
    comboBox1.Items.Add(device. Name);
    }
    comboBox1.SelectedIndex = 0; //make default to first cam
    }
    catch (ApplicationException)
    {
    DeviceExist = false;
    comboBox1.Items.Add("No capture device on your system");
    }
    }

    //refresh button
    private void rfsh_Click(object sender, EventArgs e)
    {
    getCamList();
    }

    //toggle start and stop button
    private void start_Click(object sender, EventArgs e)
    {
    if (start. Text == "&Start")
    {
    if (DeviceExist)
    {
    videoSource =
    new VideoCaptureDevice(videoDevices[comboBox1.SelectedIndex].MonikerString);
    videoSource. NewFrame += new NewFrameEventHandler(video_NewFrame);
    CloseVideoSource();
    //videoSource. DesiredFrameRate = 10;
    videoSource. Start();
    label2.Text = "Device running... ";
    start. Text = "&Stop";
    }
    else
    {
    label2.Text = "Error: No Device selected.";
    }
    }
    else
    {
    if (videoSource. IsRunning)
    {
    timer1.Enabled = false;
    CloseVideoSource();
    label2.Text = "Device stopped.";
    start. Text = "&Start";
    }
    }
    }

    //eventhandler if new frame is ready
    private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
    {
    Bitmap img = (Bitmap)eventArgs. Frame.Clone();
    // All the image processing is done here...
    pictureBox1.Image = img;
    }

    //close the device safely
    private void CloseVideoSource()
    {
    if (!(videoSource == null))
    if (videoSource. IsRunning)
    {
    videoSource. SignalToStop();
    videoSource = null;
    }
    }
    public bool winner_comp = false; // whether winner is computer
    public bool winner_you = false;// whether winner is user
    public bool tie = false;// game goes in tie
    private int[] zeros = { 0, 0, 0, 0, 0 };// stores moved played by user
    private int[] crosses = { 0, 0, 0, 0, 0 };//stores moves played by computer
    private int countero;//count the zeros played
    private int counterx;//count crosses played
    public int MakeAMove(int MyMove)//This function is called to make
    //a move by computer and takes user move as argument
    {
    zeros[countero] = MyMove; // stores the user move in member function
    countero++;
    if (counterx == 0) // if there is no crosses played make a random move
    {
    int rand_move = RandomMove();
    crosses[counterx] = rand_move;
    counterx++;
    return rand_move;
    }
    else
    {
    // this will try to win the game at first,
    // preventing the other player to win, and then tries to
    // make a move avoiding "traps" and putting
    // two computer pieces in a row
    //If none of this is possible, a random move is made.
    int[,] Pattern = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 },
    { 1, 4, 7 }, { 2, 5, 8 }, { 3, 6, 9 }, { 1, 5, 9 }, { 7, 5, 3 } };
    int Compmove = 0;
    int FinalMove = 0;
    int winning_Move = 0;
    for (int i = 0; i < 8; i++)
    {
    int oCounter = 0;
    int xCounter = 0;
    int Incase = 0;
    for (int j = 0; j < 3; j++)
    {

    if (CrossSeek(Pattern[i, j]))
    {
    xCounter++;
    }
    else if (ZeroSeek(Pattern[i, j]))
    {
    oCounter++;
    }
    else
    {
    Incase = Pattern[i, j];
    }
    }
    if (oCounter == 3)
    {
    winner_you = true;
    return 0;
    }
    else if (xCounter == 2 && Incase != 0)
    {
    winning_Move = Incase;
    }
    else if (oCounter == 2 && Incase != 0)
    {
    Compmove = Incase;
    }
    else if (oCounter

    0 && xCounter

    1)
    {
    if (Compmove == 0)
    {
    Compmove = Incase;
    }
    }
    else if (Incase != 0)
    {
    FinalMove = Incase;
    }

    }
    if (winning_Move != 0)
    {
    crosses[counterx] = winning_Move;
    counterx++;
    winner_comp = true;
    return winning_Move;
    }
    if (Compmove != 0)
    {
    crosses[counterx] = Compmove;
    counterx++;
    if (counterx

    5 || countero

    5)
    {
    winner_you = false;
    winner_comp = false;
    tie = true;
    }
    return Compmove;
    }
    if (FinalMove != 0)
    {
    crosses[counterx] = FinalMove;
    counterx++;
    if (counterx

    5 || countero

    5)
    {
    tie = true;
    }
    return FinalMove;
    }
    tie = true;
    return 0;
    }
    }
    // In case computer play first move
    public int CompFirstTurn()
    {
    int CompMove = RandomMove();
    crosses[counterx] = CompMove;
    counterx++;
    return CompMove;
    }
    // get winner is called at end to find the winner
    public bool GetWinner()
    {
    if (winner_comp || winner_you || tie)
    {
    return true;
    }
    return false;
    }
    // this searches whether any zero is placed at position passed in argument
    public bool ZeroSeek(int zero)
    {
    for (int i = 0; i < countero; i++)
    {
    if (zeros[i] == zero)
    {
    return true;
    }
    }
    return false;
    }
    // this searches whether any cross is placed at position passed in argument
    public bool CrossSeek(int cross)
    {
    for (int i = 0; i < counterx; i++)
    {
    if (crosses[i] == cross)
    {
    return true;
    }
    }
    return false;
    }
    //make a random move
    private int RandomMove()
    {
    Random random = new Random();
    int CompMove;
    bool truth = false;
    do
    {
    CompMove = random. Next(1, 10);
    if (zeros[0]

    CompMove || crosses[0]

    CompMove)
    {
    truth = true;
    }
    else
    {
    truth = false;
    }
    }
    while (truth);
    return CompMove;
    }
    }
    }
    Tümünü Göster
    ···
  11. 16.
    0
    önce tabi products adında bi class oluşturdum onuda kendine göere düzenle panpa
    bu class

    public class Products
    {
    public int ProductID { get; set; }
    public string ProductName { get; set; }
    public int SupplierID { get; set; }
    public int CategoryID { get; set; }
    public string QuantityPerUnit { get; set; }
    public decimal UnitPrice { get; set; }
    public short UnitsInStock { get; set; }
    public short UnitsOnOrder { get; set; }
    public short RecorderLevel { get; set; }
    public bool Discontinued { get; set; }
    }
    ···
  12. 15.
    0
    bak bu metodu yaz
    public static List<Products> GetAllProducts()
    {

    List<Products> result = new List<Products>();
    string sql = "SELECT * FROM [dbo].Products";
    da.SelectCommand = new SqlCommand(sql, Conn);
    da.Fill(ds, "Products");

    foreach (DataRow dr in ds.Tables["Products"].Rows)
    {
    Products item = new Products();
    item. ProductID = (int)dr["ProductID"];
    item. ProductName = dr["ProductName"].ToString();
    item. SupplierID = (int)dr["SupplierID"];
    item. CategoryID = (int)dr["CategoryID"];
    item. QuantityPerUnit = dr["QuantityPerUnit"].ToString();
    item. UnitPrice = (decimal)dr["UnitPrice"];
    item. UnitsInStock = (short)dr["UnitsInStock"];
    item. UnitsOnOrder = (short)dr["UnitsOnOrder"];
    item. RecorderLevel = (short)dr["RecorderLevel"];
    item. Discontinued = (bool)dr["Discontinued"];

    result.Add(item);
    }
    return result;


    }

    kendine göre düzenle işte
    sonra yukarda yazdığım metodu çağır formun loaduna
    bütün products verileri getiren metod

    private void Form1_Load(object sender, EventArgs e)
    {
    dataGridView1.DataSource = DataAccessLayer. GetAllProducts();
    }
    ···
  13. 14.
    0
    upupupupup
    ···
  14. 13.
    0
    veri kaynağına bağlanma kodu sql ile
    ama vb.net bilmiyorum bu c sharp
    ···
  15. 12.
    0
    @11 kaçıncı sorunun cevabıı oldugunu tam yazsan çok güzel olucak panpa
    ···
  16. 11.
    0
    connection
    private static string _connStr = "Data Source=.; Initial Catalog=VERiTABANIADI; User ID = sa; Password = 1234567?"; bunu globalde yaz

    private static SqlConnection _conn;

    private static SqlConnection Conn
    {
    get
    {
    if (_conn == null)
    {
    _conn = new SqlConnection(_connStr);
    }
    if (_conn. State

    ConnectionState. Broken || _conn. State

    ConnectionState. Closed)
    {
    _conn. Open();
    }

    return _conn;
    }
    ···
  17. 10.
    0
    upupuppu
    ···
  18. 9.
    0
    oglum gün gelir biz yardım ederiz lan
    ···
  19. 8.
    0
    uplayak biraz
    ···
  20. 7.
    0
    beyler :((
    ···