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
R

Ronenb

@Ronenb
About
Posts
45
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Linq - Conditions for two categories in parallel
    R Ronenb

    ok got it ronen

    C# database csharp linq question

  • Linq - Conditions for two categories in parallel
    R Ronenb

    hi I’ve implement your idea and it work great, thank u! I have another question and hope you can assist The use will choose from UI several filter criteria, so the running filter should be dynamic and not hard coded Such as sometimes it could be collection.Filter(name1, value1) Or collection.Filter(name1, value1).Filter(name2, value2) collection.Filter(name1, value1).Filter(name2, value2). Filter(name3, value3) and so on how can I define by code the dynamic filter? Should I use recursive ? int interaction = #UserFilter.count; DoFilter(string name, string value) { While (interaction--) { collection.Filter(UserFilter[interaction].name, UserFilter[interaction].value) DoFilter(UserFilter[interaction].name, UserFilter[interaction].value); } } thanks ronen

    C# database csharp linq question

  • Linq - Conditions for two categories in parallel
    R Ronenb

    thank u all, it is a good start to begin with

    C# database csharp linq question

  • Linq - Conditions for two categories in parallel
    R Ronenb

    Hi
    I’ve a question regarding linq,
    I’ve a DB contains main items (Product) and internal item(properties)

    Class Product
    {
    String name
    List<properties> propList { get; set; }
    }

    Class properties
    {
    String name
    String value
    }

    I would like to know if it possible to create a query that apply on two or more categories on the same internal item at one time
    Such as, if the product is “car” and if the car year is 2012 and color is “Red” I would like to get this record

    List< Product > DB;

    I know the syntax below is wrong, but this is the idea I wish to do
    Enumerable< Product > itemQuery = from item in DB where item.name=="car"
    where
    (
    from prop in item.propList
    where (prop.name.Equals("Color") && prop.value == "Red") && (prop.name.Equals("Year") && prop.value == "2012")
    select field
    ).Any()
    select item;

    C# database csharp linq question

  • how to clear memory
    R Ronenb

    Got it :) thanks all Ronen

    C# help data-structures performance tutorial question

  • how to clear memory
    R Ronenb

    ok that this is Basically what i did srLog is type of StreamReader so my problem was that i didint need to read all file content to memory and then process it :)

    I was thinking it is more efficient to read all file content (with one stroke) and work on it then to access file system for each line(ReadLine) and process it
    Isn’t more expensive?

              while (!srLog.EndOfStream)
               {
                   line = srLog.ReadLine();
                           fileLines.Add(line);
               }
               fileLinesContent = fileLines.ToArray();
    
    C# help data-structures performance tutorial question

  • how to clear memory
    R Ronenb

    thanks

    C# help data-structures performance tutorial question

  • how to clear memory
    R Ronenb

    Thank u all for the replay i think it is better to use the stream option as you suggested can you send me example how to stream a file for each line? should i use StreamFile, StreamRead or MemoryStream service? thanks ronen

    C# help data-structures performance tutorial question

  • how to clear memory
    R Ronenb

    hi the array (string []fileLinesContent) is a member of the class, not local member in func, so my question is how to clean it in order free memory and read next lines in files i'm reading the lines because i need to know when the line end and parse the element in each line ronen

    C# help data-structures performance tutorial question

  • how to clear memory
    R Ronenb

    Hi I’ve extremely log file that I need to parse, 700M I need to read the file content and parse each line, The problem is that I get exception System.outofmemory In order to solved the memory issue, I think of reading the file in pages I think of defile pageSize to be 100,000 lines In order clean memory of array such as fileLinesContent, I think of defining it as null or to call Array.Clean(fileLinesContent) Is it correct approach to clean memory of array? string []fileLinesContent; internal void ReadFile(int pageSize) { //To clean memory for garbage collector fileLinesContent=null; List fileLines = new List(); int linesNumRead=0; string line; while (linesNumRead < pageSize && !srLog.EndOfStream ) { line = srLog.ReadLine(); linesNumRead ++; } fileLinesContent = fileLines.ToArray(); } }

    C# help data-structures performance tutorial question

  • close winforms childs and main
    R Ronenb

    i'm trying to closing the app by the mainform X :), not the child form X the status is when i press the mainform X, a child win is closed, each click close child form till all childs are closed, last click on X close the app once no child exist any advice?

    C# csharp winforms question

  • close winforms childs and main
    R Ronenb

    in case i will remove closing the child manully, once i click close "X", each time child window will be closed i need to press X button accurding the number of child windows that are opend what am i'm missing? what is the correct process to close MDI application? thanks ronen

    C# csharp winforms question

  • close winforms childs and main
    R Ronenb

    Hi I have application that is define as MDI, there are several form child once the user press X button, i wish the application to be close and all other windows. at the FromClosing event i add the following code //handle and close the logic layer... foreach (Form frm in this.MdiChildren) { frm.Close(); frm.Dispose(); } Application.Exit(); All childs are closed but the the event FromClosing happen agian, why? i would expect the event of the main form FromClosing will happen only one time. this cause my problems at the logic layer ronen

    C# csharp winforms question

  • handle data in GUI (datagridview) and database
    R Ronenb

    thank you very much for your input

    C# database question hardware announcement

  • handle data in GUI (datagridview) and database
    R Ronenb

    thanks for the tips the apps should be run localy, can i stll run web service, the service should collect the data and insert to db? i'm think of using several threads in te App (one handling the data recieving, one for processing and store in DB, and one for displaying thanks ronen

    C# database question hardware announcement

  • handle data in GUI (datagridview) and database
    R Ronenb

    I'm develop a online logger monitor, i know the user could be able to read the db in the grid The grid will be update each second with amount of data that I will define (such as 200 events) i'm asking about the Implementation ronen

    C# database question hardware announcement

  • handle data in GUI (datagridview) and database
    R Ronenb

    Hi All I need your advice what is the best solution to handle data I’m developing online logger application at windows that will be connected to hardware. The application should handle heavy traffic data( could be up to hundreds of events per second) The datagridview is active as viewer only (readonly). I need to develop mechanism of insert the events to DB and display them in the datagridview. I need your advice if this is correct approach? I’m thinking of using the flow below Init() { SqlConnection connection = new SqlConnection(connectionstring); connection.open() SqlDataAdapter adapter = new SqlDataAdapter("select * from TableName", connection); DataSet ds = new DataSet(); dataGridView1.DataSource = ds; ); } AddRow(data) { //Add to database string insertString = "insert into TableName (Field1, Field2) values (‘Value1’,’Value2’)"; // 1. Instantiate a new command with a query and connection SqlCommand cmd = new SqlCommand(insertString, connection); // 2. Call ExecuteNonQuery to send command cmd.ExecuteNonQuery(); } //each second the timer event occurs Timer () { adapter.Fill(ds,idxLastUpdatedRow,100/* update 100 records each time*/ ,tableName); dataGridView1.refresh() } Thanks Ronen

    C# database question hardware announcement

  • how to waiti for specific events that occurs
    R Ronenb

    I’ve using a Queue to store data and I do polling in order to know if the Queue contain data ( that I understand is not the correct approach) For Example private void PopDataFromQueue() { bool isRspOK; byte [] data; while (true) { //If so then stop the thread if (m_isStopReadingQueueThread == true) break; if (m_queue.Count > 0) { lock (m_queue) { if (m_queue.Count > 0) { data = (byte [])m_queue.Dequeue(); isRspOK = m_scenario.Parse(sockBuf.SocketData); if (isRspOK == true) { ; } } } } } I need to implement approach that wait for event occur and not always check the Queue status The function PopDataFromQueue is define as a thread Something like this private void PopDataFromQueue() { //create timer event that indicate in case the event that I waiting for not reach after some time , need to handle it Timer timer = new timer(1000); while (true) { //If so then stop the thread if (m_isStopReadingQueueThread == true) break; Event = WaitForEvent(Queue.Add,Timer. expire); // need to wait for two type of events Switch(Event) { case Queue.Dataexist: data = (byte [])m_queue.Dequeue(); isRspOK = m_scenario.Parse(sockBuf.SocketData); if (isRspOK == true) { ; } Break; Case timer.expire: isStopReadingQueueThread =true; break; } } } I try to look in the net and I didn’t

    C# tutorial data-structures

  • sizeof struct with array
    R Ronenb

    I see OK Thanks Ronen

    C# data-structures help

  • sizeof struct with array
    R Ronenb

    Hi But I define the size of the array size in the constructor Should the size of the member of the struct include array definitions? Ronen

    C# data-structures help
  • Login

  • Don't have an account? Register

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