forked from narendrasinghrathore/MyNoteBook_v1.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeClass.cs
More file actions
42 lines (27 loc) · 1.19 KB
/
TimeClass.cs
File metadata and controls
42 lines (27 loc) · 1.19 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace MyNoteBook_v1._0
{
class TimeClass
{
public void getandsettaskdone(string mytask)
{
using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyNoteBook_v1._0.Properties.Settings.largedbConnectionString"].ConnectionString)) {
SqlDataAdapter da = new SqlDataAdapter();
da.InsertCommand = new SqlCommand("ActivityLog_sp", cn);
da.InsertCommand.CommandType = CommandType.StoredProcedure;
da.InsertCommand.Parameters.AddWithValue("@task", mytask);
da.InsertCommand.Parameters.AddWithValue("@date",System.DateTime.Now.ToLongDateString());
da.InsertCommand.Parameters.AddWithValue("@time", System.DateTime.Now.ToString("HH:mm:ss tt"));
cn.Open();
da.InsertCommand.ExecuteNonQuery();
}
}
}
}