Professional Documents
Culture Documents
cs 1
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.SqlClient;
using System.Net;
namespace WindowsFormsApplication1
{
public partial class Form3 : Form
{
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-SHIVA\SQLEXPRESS;Initial
Catalog=shivam1;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
string str;
public Form3()
{
InitializeComponent();
con.Open();
cmd.Connection = con;
cmd.CommandText = str;
while (rdr.Read())
{
id.Text = rdr.GetInt32(0).ToString();
name.Text=rdr.GetString(1);
price.Text = rdr.GetInt32(2).ToString();
manufacturer.Text = rdr.GetString(3);
description.Text = rdr.GetString(4);
//code for displaying image(barcode)
Byte[] byteBLOBData = new Byte[0];
byteBLOBData = (Byte[])((byte[])rdr["img"]);
System.IO.MemoryStream ms = new System.IO.MemoryStream(byteBLOBData);
barcode.Image = System.Drawing.Image.FromStream(ms);
}
con.Close();
}
C:\Users\shiva\OneDrive\Documents\Visual ... Generator\WindowsFormsApplication1\Form3.cs 2
}