-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask12_04(1).cs
57 lines (41 loc) · 2.05 KB
/
task12_04(1).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
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace data
{
class Class6
{
public static void Main()
{
// SqlConnection con = new SqlConnection("Data source =DESKTOP-7MGGRB4; database =Anand; user id = sa;password = P@ssword");
// string sqlqry = "create table enroll(sno int,Fname varchar(20),Lname varchar(20),Gender varchar(20));
// SqlCommand cmd = new SqlCommand(sqlqry, con);
// con.Open();
// cmd.ExecuteNonQuery();
// con.Close();
// Console.WriteLine("created successfully");
// SqlConnection con = new SqlConnection("Data source =DESKTOP-7MGGRB4; database =Anand; user id = sa;password = P@ssword");
// string sqlqry = "insert enroll values(1001,'Anand','kumar','M')";
// SqlCommand cmd = new SqlCommand(sqlqry, con);
// con.Open();
//cmd.ExecuteNonQuery();
// con.Close();
// Console.WriteLine("Row Inserted");
// SqlConnection con = new SqlConnection("Data source =DESKTOP-7MGGRB4; database =Anand; user id = sa;password = P@ssword");
// string sqlqry = "delete from enroll where Fname='Anand'";
// SqlCommand cmd = new SqlCommand(sqlqry, con);
// con.Open();
// cmd.ExecuteNonQuery();
// con.Close();
// Console.WriteLine("Deleted is done");
// SqlConnection con = new SqlConnection("Data source =DESKTOP-7MGGRB4; database =Anand; user id = sa;password = P@ssword");
//string sqlqry = "update enroll Set Fname='Thangam' Lname='Kar' where Gender='F'";
// SqlCommand cmd= new SqlCommand("update tbl_enrollment Set Fname='Thangam' Lname='Kar' where Gender='F'", con);
// con.Open();
// cmd.ExecuteNonQuery();
// con.Close();
//Console.WriteLine("Updated is done");
}
}
}