Click here to Skip to main content
15,914,419 members

Comments by MI_KRISHNAN (Top 10 by date)

MI_KRISHNAN 25-Jan-17 5:18am View    
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.IO.Ports;
using System.Threading;
using System.Data.SqlClient;
using System.IO;
using DirectX.Capture;
using DShowNET.Device;
using System.Text.RegularExpressions;
using Microsoft.VisualBasic.PowerPacks;



namespace LINEAR_SC
{
public partial class Form1 : Form
{
public DirectX.Capture.Filter Camera;
public DirectX.Capture.Capture CaptureInfo;
public DirectX.Capture.Filters CamContainer;
Image captureImage;
SerialPort _serialPort;
Double Disp, Init_Disp;
int ri = 0;
int lastX = 0;
int lastY = 0;
public Form1()
{
InitializeComponent();
}

public SqlConnection GetsqlCon()
{
string connstring = "Data Source=.\\SQLEXPRESS;Initial Catalog=UI;Integrated Security=True";
SqlConnection mycon = new SqlConnection(connstring);
return mycon;
}
public bool getComm(string connstring1)
{
try
{
SqlConnection sqlcon = this.GetsqlCon();
SqlCommand sqlcomm = new SqlCommand(connstring1, sqlcon);
sqlcon.Open();
sqlcomm.ExecuteNonQuery();
sqlcomm.Dispose();
sqlcon.Close();
sqlcon.Dispose();
return true;
}
catch (Exception ex1)
{
return false;
}

}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
Region r = new Region();
r.Union(new Rectangle(0, lastY, this.Width, 1));
r.Union(new Rectangle(lastX, 0, 1, this.Height));
this.Invalidate(r);
this.Update();
Graphics g = Graphics.FromHwnd(this.Handle);
g.DrawLine(Pens.Black, 0, e.Y, this.Width, e.Y);
g.DrawLine(Pens.Black, e.X, 0, e.X, this.Height);
lastX = e.X;
lastY = e.Y;
}

private void Form1_MouseLeave(object sender, EventArgs e)
{
this.Invalidate();
}
private void button2_Click(object sender, EventArgs e)
{
//_serialPort = new SerialPort(portNameComboBox.Text, Convert.ToInt32(baudRateComboBox.Text), Parity.None, 8, StopBits.One);
//_serialPort.Handshake = Handshake.None;
//_serialPort.Open();
//timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
string data = _serialPort.ReadExisting();
String[] qw = data.Split('#');
if (qw.Length > 2)
{
data = qw[1];
if (data.Length == 35)
{
Disp = Convert.ToDouble(data.Substring(16, 11));
label3.Text = ((Disp - Init_Disp) / 1000).ToString();
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
{
CamContainer = new DirectX.Capture.Filters();
try
{
int no_of_cam = CamContainer.VideoInputDevices.Count;
for (int i = 0; i < no_of_cam; i++)
{
try
{
// get the video input device
Camera = CamContainer.VideoInputDevices[i];

// initialize the Capture using the video input device
CaptureInfo = new DirectX.Capture.Capture(Camera, null);

MI_KRISHNAN 22-Jul-16 3:59am View    
near
"i = cmd.ExecuteNonQuery();"
MI_KRISHNAN 22-Jul-16 3:58am View    
same error continuous.....
MI_KRISHNAN 22-Jul-16 3:58am View    
tried bro....
MI_KRISHNAN 17-Dec-15 7:46am View    
I have another doubt
static float billno = ICPL/15/CL0055/M-01;
billno = billno + 1;
textBox1.Text = billno.ToString();


is it possible