Click here to Skip to main content
15,893,161 members
Home / Discussions / C#
   

C#

 
AnswerRe: number converter Pin
palikhelsanjeeb25-Jan-17 21:55
palikhelsanjeeb25-Jan-17 21:55 
QuestionHow to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu22-Jan-17 21:49
professionalTarunKumarSusarapu22-Jan-17 21:49 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Afzaal Ahmad Zeeshan22-Jan-17 23:43
professionalAfzaal Ahmad Zeeshan22-Jan-17 23:43 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:44
professionalTarunKumarSusarapu23-Jan-17 0:44 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Afzaal Ahmad Zeeshan23-Jan-17 1:08
professionalAfzaal Ahmad Zeeshan23-Jan-17 1:08 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Simon_Whale23-Jan-17 0:27
Simon_Whale23-Jan-17 0:27 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:45
professionalTarunKumarSusarapu23-Jan-17 0:45 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Pete O'Hanlon23-Jan-17 0:46
mvePete O'Hanlon23-Jan-17 0:46 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Simon_Whale23-Jan-17 0:47
Simon_Whale23-Jan-17 0:47 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:54
professionalTarunKumarSusarapu23-Jan-17 0:54 
SuggestionRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Richard Deeming23-Jan-17 3:17
mveRichard Deeming23-Jan-17 3:17 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 18:10
professionalTarunKumarSusarapu23-Jan-17 18:10 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 18:57
professionalTarunKumarSusarapu23-Jan-17 18:57 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Richard Deeming24-Jan-17 2:05
mveRichard Deeming24-Jan-17 2:05 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu24-Jan-17 0:24
professionalTarunKumarSusarapu24-Jan-17 0:24 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Gerry Schmitz23-Jan-17 8:39
mveGerry Schmitz23-Jan-17 8:39 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 18:13
professionalTarunKumarSusarapu23-Jan-17 18:13 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Gerry Schmitz23-Jan-17 19:07
mveGerry Schmitz23-Jan-17 19:07 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu24-Jan-17 0:52
professionalTarunKumarSusarapu24-Jan-17 0:52 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Gerry Schmitz24-Jan-17 2:36
mveGerry Schmitz24-Jan-17 2:36 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
palikhelsanjeeb25-Jan-17 21:13
palikhelsanjeeb25-Jan-17 21:13 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu29-Jan-17 19:00
professionalTarunKumarSusarapu29-Jan-17 19:00 
QuestionHaving trouble closing and reopening of communication port RS232 Pin
goldsoft21-Jan-17 1:40
goldsoft21-Jan-17 1:40 
hi
I'm trying to get the weight attached to a computer using RS232 com port.

I can read the weighing, but when I walk out the form , and came again -

My program and computer freezing.

this is my code:
private void Main_Load(object sender, EventArgs e)
{ 
    port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
    port.DataReceived += new s system.IO.Ports.SerialDataReceivedEventHandler(Recepcion);

    if (port.IsOpen == false)
    {
      try
      {
         port.Open();
      }
      catch (Exception oex)
      {
          MessageBox.Show(oex.ToString());
      }
    }
}

private void Actualizar(object s, EventArgs e)
{
   //I try this
   lblMSG.Text = ExtractDecimalFromString(port.ReadLine()).ToString();
   port.DiscardInBuffer();

   //Also I try this
   lblMSG.Text = ExtractDecimalFromString(port.ReadExisting()).ToString();
   port.DiscardInBuffer();
}

private void Recepcion(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
  try
  {
     this.Invoke(new EventHandler(Actualizar));
  }
  catch { }
}

and when i close the form i do this:
 port.DataReceived -= new System.IO.Ports.SerialDataReceivedEventHandler(Recepcion);

GC.Collect();   //also i try to remark this
port.Close();
port.Dispose();
this.Close();

It is not always freezes, sometime yes...sometime no....

I searched the entire network still does not answer and solution.

I'm really despair. I wish to find a solution here
AnswerRe: Having trouble closing and reopening of communication port RS232 Pin
Afzaal Ahmad Zeeshan21-Jan-17 2:04
professionalAfzaal Ahmad Zeeshan21-Jan-17 2:04 
GeneralRe: Having trouble closing and reopening of communication port RS232 Pin
goldsoft22-Jan-17 10:19
goldsoft22-Jan-17 10:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.