Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Admin887

@Admin887
About
Posts
33
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • StreamReader.readline() problem
    A Admin887

    it stucks on readLine. i mean, the processor arrives to this line (line= sr.readline()) and just stop. even if i add another line to while:

    while(!sr.endOffile)
    {
    line= sr.readline(); <------------it stops here------
    messageBox.show("Just string"); the processor do not arrive to this line

    }

    the processor stops working even if the Stream is not endOfFile. Why?! P.S i changed !sr.endofFile to line!=null it is still not working...

    C# help tutorial question

  • StreamReader.readline() problem
    A Admin887

    hi, i have a program that receiving inforamtion from a port (SerialPort object). i am reading the port's information(Stream) from another object by StreamReader like this:

    SerialPort port=new SerialPort(.....);
    port.NewLine= "\r";
    StreamReader sr=new StreamReader(port.BaseStream);

    while reading the the stream to the end:

    while (!sr.endOfFile)
    {
    line= sr.readLine();
    }

    this Method stucks on the last line on the stream.it reads all the Stream except the last line. But after adding information (Strings) to the stream (from the port).. it continues reading the last line with the new information... do you know how to solve it? thank you.. P.S Maybe..is it something with the sr.NewLine argument?

    C# help tutorial question

  • Idea for reading ad writing at the same time
    A Admin887

    i thought about it but.. opening and closing the file a lot of times will not slow down the analizing time? maybe there is something like "virtual file" or another solution that will let update the real file every X seconds?(for backup). or this is the only way to solve this problem?

    C# question

  • Idea for reading ad writing at the same time
    A Admin887

    now, i can analize a file (file.log) convert it to StreamReader and analize it with my object Parser(StreamReader sr). (i am using there sr.readline() etc.) now i want to receive the same information from port. i want to receive information from port232 (strings) and to save them (somewhere),and to analize them with th same object Parser(StreamReader sr) on a real time(2 threads- one for writing information from port to StreamReader(possible???) and another thread for reading the inforamtion by using Parser). thank you.

    C# question

  • Idea for reading ad writing at the same time
    A Admin887

    hi, someone has an idea for object the i can write to it strings (with the first thread) and read from this object at th same time(with the second thread)? it will be very helful if this object will can convert itself to StreamReader. thank you.

    C# question

  • SerialPort output problem
    A Admin887

    first of all, thank you for your attention. [SP] (space in ASCII)= means that there is space in line [CR] (New row in ASCII)= means that there is a new row for example this line: I am going to show you something i want to get: I[SP]am[SP]going[SP]to[SP]show[SP]you[SP]something[CR] while reading from the port,i get the information in one row. i want to separate and to know when a row is ends- [CR]. i know that there is method port.readline() but the application stucks on this line. maybe there is another solution to know where the line is ends. (i means, when i send two lines to the port from the first computer - on the second computer, i get 1 long row). there is another way to solve it?

    C# question sharepoint com help

  • SerialPort output problem
    A Admin887

    hi, i connected 2 computers with COM cable (RS232). i created 2 application for sending and receiving information. i tried to send information from the first computer and to see it at Listen32 program on the other computer. I get the information correctly with [CR] and [SP] -(that what i wants) . But In my receiving application i get information without these ( [SP] [CR]). how can i change the Encode and to get information with [SP] and [CR]? My Sending Application

    namespace WindowsFormsApplication14
    {
    public partial class Form1 : Form
    {
    SerialPort port;
    public Form1()
    {
    InitializeComponent();
    port = new SerialPort("COM1", 2400, Parity.None, 8, StopBits.One);
    port.Open();
    }

        private void button1\_Click(object sender, EventArgs e)
        {
            port.Write(textBox1.Text);
        }
    
        private void button2\_Click(object sender, EventArgs e)
        {
            port.Close();
        }
    }
    

    }

    my receiving application

    namespace WindowsFormsApplication3
    {
    public partial class Form1 : Form
    {
    private SerialPort p = new SerialPort("COM1", 2400, Parity.None, 8, StopBits.One);

        public Form1()
        {
            InitializeComponent();
    
            CheckForIllegalCrossThreadCalls = false;
           
            Thread t = new Thread(new ThreadStart(SerialPortProgram));
           
            t.Start(); 
        }
    
    
        public void SerialPortProgram()
        {
                p.DataReceived += new SerialDataReceivedEventHandler(port\_DataReceived);
                p.Open();
               Application.Run();
    
            }
    
        private void port\_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
    
    
            textBox1.Text += p.ReadExisting();
         
        }
    
    C# question sharepoint com help

  • How to read Hebrew letters with StreamReader
    A Admin887

    hi, i have a file with Hebrew letters. while reading the file with:

    string s;
    SreamReader SR=new StreamReader(Dir);
    s= SR.readLine();

    the string contains: ����� (something strange) and not hebrew letters. how can i receive hebew letters? i have Microsoft Visual Studio 2008 thank you

    C# question csharp visual-studio tutorial

  • How to access a comboBox in dataGridView?
    A Admin887

    Thank you!! :D i am very appreciate your help :D thank you again!

    C# question tutorial

  • How to access a comboBox in dataGridView?
    A Admin887

    hi, i have a small question.. How can i add and access a ComboBox in dataGridView.. i means,how can i add new Lines in these ComboBoxes and check which line is selected? thank you G.

    C# question tutorial

  • How to create a progressBar?
    A Admin887

    ooo thank you... it was very helpful!

    C# question tutorial

  • How to create a progressBar?
    A Admin887

    Thank you!!! ;)

    C# question tutorial

  • How to create a progressBar?
    A Admin887

    Thank you..it was very helpful.. :-D

    C# question tutorial

  • How to create a progressBar?
    A Admin887

    DO you have any link that shows to me how to do it? thank you

    C# question tutorial

  • How to create a progressBar?
    A Admin887

    hello, i just want to know how can i create a Progressbar that represent the progress of a specific Form. i mean, i have a Form with a lot of steps..that caculate a lot of things. while wating that this progress will finish, i want to see the progress in the progressBar.. How can i do it? thank you

    C# question tutorial

  • Updating mdb file
    A Admin887

    Thank you! that was perfect :-D

    C# css announcement

  • Updating mdb file
    A Admin887

    i am trying to update a mdb file. i added a new rows to the dataset and now i am trying to update a empty mdb file to the content of the dataset. i did something but i received an exception: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. my code is:

    string connectionString = "provider=Microsoft.JET.OLEDB.4.0; " + "data source =" + Dir;
    string commandString = "Select id,name from table";

    OleDbDataAdapter dataAdapter = new OleDbDataAdapter(commandString, connectionString);
    My_DataSet = new DataSet();
    OleDbCommandBuilder cb = new OleDbCommandBuilder(dataAdapter);
    dataAdapter.Fill(My_DataSet, "Events");

    //here i added some new rows to the dataset

    dataAdapter.Update(My_DataSet, "Events"); // The exception is here

    C# css announcement

  • How to save DataSet to exist MDB file?
    A Admin887

    How to save DataSet to exist MDB file?

    C# tutorial question

  • Resizing TextBox while resizing window
    A Admin887

    How can i change the size of a textbox(Which exists on the window) while resizing the window size? Thank you

    C# question

  • How to insert a new row to MDB file [modified]
    A Admin887

    First of all, i wrote execly the same Subject yesterday but i didnt understand the answer.. :( i want to add a new row to specific MDB file... my code is:

    string connectionString = "provider=Microsoft.JET.OLEDB.4.0; " + "data source =" + Dir;

    string commandString = "Select id,Event from Events";

    OleDbDataAdapter dataAdapter = new OleDbDataAdapter(commandString, connectionString);
    DataSet ds = new DataSet();
    dataAdapter.Fill(ds, "Events");

    DataTable datatable = ds.Tables[0];
    DataRow newRow = datatable.NewRow();
    newRow["id"] = "aaa";
    newRow["Event"] = "bbb";

    datatable.Rows.Add(newRow);

    dataAdapter.Update(ds, "Events");
    ds.AcceptChanges();
    Application.DoEvents();

    i did this code but it pop a exception: "Update requires a valid InsertCommand when passed DataRow collection with new rows" What i need t do? and where? thank you very Much G.

    modified on Thursday, July 31, 2008 3:59 AM

    C# tutorial question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups