-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharruma_banco.cs
46 lines (39 loc) · 1.06 KB
/
arruma_banco.cs
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
44
45
46
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Odbc;
namespace WindowsFormsApplication2
{
public partial class arruma_banco : Form
{
public arruma_banco()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DataSet ds = null;
string select = "select * from vendas";
var conn = new OdbcConnection();
conn.ConnectionString =
"Dsn=odbc_pliniao_velho;" +
"Uid=sa;" +
"Pwd=chico110388;";
conn.Open();
OdbcCommand cmd = new OdbcCommand(select, conn);
OdbcDataReader dr = cmd.ExecuteReader();
int i = 0;
while (dr.Read())
{
i++;
}
MessageBox.Show(i.ToString());
conn.Close();
}
}
}