I tried taking a stab at creating a service program that continuously reads an SQL table for information. My problem is that the service stays in "Starting" status, and never finishes starting. It works great, and does exactly what it is suppossed to do, but that "Starting" is knawing at the back of my mind. If I remove the code that actually does the SQL read, it starts fine...of course it doesn't do anything... Can anyone tell me where I am being the idiot?!?!
I put my code below, but couldn't find a way to make it pretty..sorry.
Jeff
namespace
{
InitializeComponent();
}
beginService();
#region
ConnectionString +=
SQLConnection.ConnectionString = ConnectionString;
SQLConnection.Open();
SQLConnection.Dispose();
ErrorMessage +=
ErrorMessage += Ex.Message;
fail=
MainLine(SQLConnection,
SQLConnection.Close();
prtreader = prtcommand.ExecuteReader();
prtreader.Read();
ID = (prtreader[
prt_address = (prtreader[
item = (prtreader[
item10 = item.Substring(0, 10);
img = (prtreader[
fam_descraw = (prtreader[
prod_desc = (prtreader[
pcs = (prtreader[
length_ctn = (prtreader[
finish = (prtreader[
lsize = (prtreader[
color = (prtreader[
trademark = (prtreader[
fam_size = (prtreader[
metric_carton = (prtreader[
shift = (prtreader[
user = (prtreader[
monthDayYear = (prtreader[
plant = (prtreader[
batch = (prtreader[
workCenter = (prtreader[
pcs = pcs.TrimStart(zeros);
length_ctn = length_ctn.TrimStart(zeros);
metric_carton = metric_carton.TrimStart(zeros);
fam_desc = fam_descraw.Replace(
format =
prtreader.Close();
prtreader.Dispose();
prtcommand.Dispose();
m_socClient =
System.Net.
m_socClient.Connect(remoteEndPoint);
// string qty = "PQ0001";
fmtreader = fmtcommand.ExecuteReader();
a = TrimString(fmtreader[
a = a.Replace(
objData += a;
fmtreader.Close();
fmtreader.Dispose();
fmtcommand.Dispose();
m_socClient.Send(byData);
m_socClient.Close();
dltcommand.Dispose();
str = reg.Replace(str,
#endregion