Har qanday taraqqiy etgan jamiyat hayotida axborotning ahamiyati uzluksiz ortib bormoqda



Yüklə 1,81 Mb.
səhifə18/18
tarix09.09.2022
ölçüsü1,81 Mb.
#63505
1   ...   10   11   12   13   14   15   16   17   18
asosiy qism111

Form3.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;
using System.Configuration;

namespace MySecureOTP


{
public partial class Form3 : Form
{
SqlConnection conn;
string connstring;
public Form3()
{
InitializeComponent();
connstring = ConfigurationManager.ConnectionStrings["MySecureOTP.Properties.Settings.MySecureOTPConnectionString"].ConnectionString;
}

public void open_mijoz()


{
using (conn = new SqlConnection(connstring))
using (SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM mijoz", conn))
{
DataTable usertable = new DataTable();
adapter.Fill(usertable);
dataGridView1.DataSource = usertable;
}
}

void otpshow() // organizatsiya nomini olish


{
SqlDataReader myreader;
string query = "SELECT * FROM mijoz";
using (conn = new SqlConnection(connstring))
using (SqlCommand command = new SqlCommand(query, conn))
{
conn.Open();
myreader = command.ExecuteReader();
while (myreader.Read())
{
string sname = myreader.GetString(1);
textBox1.Text = sname;
//textBox24.Text = sname;
}
}
}
private void Form3_Load(object sender, EventArgs e)
{
open_mijoz();
otpshow();
}
}
}
Form4.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MySecureOTP


{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
}
}
}



Yüklə 1,81 Mb.

Dostları ilə paylaş:
1   ...   10   11   12   13   14   15   16   17   18




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin