forked from adreena/Asset_Mng
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfullsearch.cs
More file actions
43 lines (38 loc) · 3.62 KB
/
fullsearch.cs
File metadata and controls
43 lines (38 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Asset_Mng
{
public partial class fullsearch : Form
{
public fullsearch()
{
InitializeComponent();
}
private void fullsearch_Load(object sender, EventArgs e)
{
SqlConnection connection = Main.connection;
connection.Open();
string id = Main.id;
string com = "SELECT * From V2 WHERE [شناسه] like '%" + id + "%' or [نوع] like '%" + id +
"%' or [نام] like '%" + id + "%' or [واحد] like '%" + id +
"%' or [اتاق] like '%" + id + "%' or [مالکیت] like '%" + id + "%' or [وضعیت] like '%" + id + "%' or [مدل] like '%" + id + "%' or [تاریخ_خرید] like '%" + id + "%' or [اتمام_گارانتی] like '%" + id +
"%' or [نام ، نام خانوادگی] like '%" + id + "%' or [تلفن داخلی] like '%" + id + "%' or [ایمیل] like '%" + id +
"%' or [سمت] like '%" + id + "%' or [نام_شرکت] like '%" + id + "%' or [رابط] like '%" + id + "%' or [تلفن] like '%" + id + "%' or [وب_سایت] like '%" + id + "%' or [آدرس] like '%" + id + "%';";
SqlCommand command = new SqlCommand(com, connection);
SqlDataAdapter da = new SqlDataAdapter(command.CommandText.ToString(), connection);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt);
BindingSource bs = new BindingSource(dt, null);
dataGridView1.DataSource = bs;
bindingNavigator1.BindingSource = bs;
connection.Close();
}
}
}