Skip to content

Instantly share code, notes, and snippets.

View SajjadArifGul's full-sized avatar
👨‍💻

Sajjad Gul SajjadArifGul

👨‍💻
View GitHub Profile
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.Runtime.InteropServices;
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.IO;
// Get the files from Clipboard into Array of String.
string[] file_names = (string[])Clipboard.GetData(DataFormats.FileDrop);
// Paste data in the control.
lstFiles.DataSource = file_names;
// Creating a list of File.
List<string> file_list = new List<string>();
//Putting Files from any Directory to this List by foreach loop.
foreach (string file_name in Directory.GetFiles(Application.StartupPath))
file_list.Add(file_name);
//Clear the already copied Data of clipboard.
Clipboard.Clear();
//Copying File List to the Clip Board.
Clipboard.SetData(DataFormats.FileDrop, file_list.ToArray());
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;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//adding reference to library
using System.Drawing.Imaging;
//Create Database through Query :
Create DATABASE Customers_Database;
//Create a Table of Customer & its Attributes with Respective Data types & Primary Key through Query.
Create Table Customers
(
CustomerID int,
CustomerName char(200),
ContactName char(200),
Adress char (500),
string AQ = string.Format("Update CustomerDetail Set CustomerName='"+CustomerName+"', CustomerAddress='"+CustomerAddress+"' where CustomerID='"+CustomerID+"'");
q.Conect(AQ, path);
CustomerID = Convert.ToInt32(CustomerIDTextBox2.Text);
dataGridView4.Show();
SqlConnection con = new SqlConnection(path);
con.Open();
SqlCommand com = new SqlCommand("Select * From InvoiceDetails where CustomerID = '" + CustomerID + "'", con);
SqlDataAdapter sda = new SqlDataAdapter(com);
DataTable dt = new DataTable();
sda.Fill(dt);
Query q = new Query();
string AQ = string.Format("Insert Into InvoiceDetails (CustomerID, InvoiceID, Date,ItemID,ItemName,ItemQuantity,ItemUnitPrice, ItemTotalAmount,TotalBill) Values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", CustomerID, InvoiceID, Date, BookID, BookName, BookQuantity, BookUnitPrice, BookTotalPrice, TotalBillAmount);
q.Conect(AQ, path);