DdoubleD 315 Posting Shark

Demonstrates using .NET Remoting to broadcast to client subscribers. There are three parts:

1) Server.cs - for console app responsible for broadcasting messages (date/time stamp currently)
2) Client.cs - for console app that registers with server to subscribe to broadcasts
3) Agent.cs - class library that facilitates/eposes the interfaces for our client/server communication
To use, create the three project types defined above and include the appropriate code found in this snippet. In both the Server and Client projects, add references to the Agent.DLL project. Then, modify the IP address in the ClientClass's creation of the AbstractServer remoteObject to a string that represents your server's IP.

I began this experiment 2 - 3 weeks ago and have been waiting to perform static IP testing outside my LAN/LOCALMACHINE, but have not yet been able to. I decided to go ahead and comment the code, readying it for posting, while I was reading a very interesting and informative post titled "Peer to Peer Chat", which has nothing to do really with this snippet (LOL). Anyway, I have commented my code and am posting it as-is, but I think it should work over the internet.

Server broadcast events occur on a Timer (timer code aquired via a thread replied to by sknake--I love this guy's code!). The clients receive the broadcast by registering an event handler with the server (ClientEventHandler).

Communication/interfacing accomplished ia client adding a broadcast event handler (+= ClientEventHandler) …

DdoubleD 315 Posting Shark

Please mark as SOLVED unless you are still having trouble.

DdoubleD 315 Posting Shark

Thanks thanks a lot for the tip. Thats what i am doing. But can someone tell me more about the software?? Will SQL Server Express be sufficient ??

Thanks a lot in advance
Regards,
Mike

Here are side-by-side comparisons you can use to determine whether your Express edition is sufficient for testing what you are developing and license compliance: http://www.microsoft.com/Sqlserver/2005/en/us/compare-features.aspx

EDIT: for VS 2008 products (doc/pdf download): http://www.microsoft.com/downloads/details.aspx?FamilyId=727BCFB0-B575-47AB-9FD8-4EE067BB3A37&displaylang=en

DdoubleD 315 Posting Shark

In line 2, all you are doing is appending your select statement to fullpath., which means you are trying to open file: "d:\\Pictures\\SELECT fileName from memberinfo", which does not exist I would imagine.

You need to retrieve "filename" from your database first, if that is where it is stored. You have the select statement (it appears) and I believe you said you saved the filename in your DB, right?

EDIT: Oh, I have seen you are also wanting to store and retrieve the actual image file from your database, which you have not yet achieved either?

DdoubleD 315 Posting Shark

Begin your search in this forum, where you will find all kinds of examples. Here's a hint for your search: author = sknake

As far as your 2005 Express question, I really don't know, but I would think that you just need to use a compatible connection string...

DdoubleD 315 Posting Shark
// Stop the annoying BEEP when user presses ENTER or ESCAPE...
        protected override void OnKeyPress(KeyPressEventArgs e) 
        {
            if (e.KeyChar == (char)Keys.Enter || e.KeyChar == (char)Keys.Escape)
            {
                e.Handled = true;   // stop annoying beep
            }
            
            // call base handler...
            base.OnKeyPress(e);
        }
DdoubleD 315 Posting Shark

Hmmm, this application has changed a bit since my original contribution. Having to figure out exactly what it is supposed to do is the majority of the work I would say. I have been stepping through CompareString and CompareWord methods, and I believe I have been misunderstanding what you are doing all along.

First, let me say your search code is very interesting. However, your program has little or no embedded comments explaining how the FormSearcher class is supposed to work, so I need you to verify my understanding before I continue further because I don't want to waste any more time proceeding down a falsely assumed path...

As I understand it, and you need to make sure I haven't missed anything, this is how you are determining whether the given string is enough of a match to constitute the form item being displayed:

Regarding user supplied string:
1) words to compare are whitespace delimited and must be at least 2 chars in length
1a) correction (see SPLIT comment below) : there is always only one word with whitespace removed!!!

For each word (loop) against the complete form's string:
2) each word is compared to the form's string by finding the location in the form's string where the 1st character of the word is found
3) you then remove that character from the form's string and beginning again with the 2nd character of the word
4) each found word character gets …

DdoubleD 315 Posting Shark

Thanks for your reply.............

My application is attached here and in this the percentage match code is in "FormSearcher Class " .
I just want if the entered string matches100% ,then it will be on top or if it matches 50% or more with the formText ,then maximum matched result should be at top while others below( in the decreasing order of match percentage ).Like if the one formtext matches 90% ,second 85%,third 75% and fourth 50% while other formtext do not match at all, then 90%matched result should be at top ,then 85%,then 75%,then 50%. while others which do not match at all or match less than 50% should not be displayed.All the results which matches 50% or more should display ..................
Hope you understand....

I will take a look at this today. Having no idea the exact rules constituting those percentages you mention, I'll just "cross my fingers" and hope that whatever routine is already written to match an "acceptable percentage" agrees with your perception of what does and does not partially match.

DdoubleD 315 Posting Shark

I haven't played with DDE, and from what I've heard about it, I don't think I want too. Are you truly limited to using DDE, or could you implement what you need using Remoting or WCF?

DdoubleD 315 Posting Shark

I would like to clarify what you want because your title and last statement conflict a little I think. Are you wanting to have the client/server application send data directly to another client/server application, bypassing writing/reading to an excel spreadsheet (perhaps as it currently is doing)?

DdoubleD 315 Posting Shark

OK, I think I understand now. It's a good thing I asked, because I didn't realize you expected "eval 2/3" to match "evaluate 2/3". Anyway, I know either sknake or Ryshad provided you code to match a percentage of the text. Tell me where that is so I can incorporate into the rebuilding of the list.

One last question, if I understood your last response, you now want every list item that does NOT match to be removed from your list instead of just moving the matching items to the top?

DdoubleD 315 Posting Shark

thanks , I Upload the file in this Link

When I want to Load App. , I want to insert a Suitable Value to the Rows of Column1 .

I played around with this a little bit and it has taken me a little time to figure out some things, but I think understand what you are trying to do now. Unfortunately, I have some other errands to attend to in a moment, but here are some tips for whoever endeavors...

  • Remove the path from the filename in the conect string
  • Find the spreadsheet in the root folder of the extract, and copy this file into the debug folder because the one currently in the debug folder is NOT a good sample!
  • The imported values in the grid translate to double types
  • Column1 can probably be populated with a modulo algorythm
DdoubleD 315 Posting Shark

how do I unlock the file before displaying it on another picturebox

You can destroy (Dispose() of) the previous Image that was loaded using the FromFile, or you can use this instead of FromFile to return an Image from a file:

public Image ImageFromFileNoLock(string fileName)
        {
            // Image.FromFile will hold a lock on the file until the image is destroyed,
            // so using a FileStream to load the file will release lock before returning image
            // because the stream gets closed...
            FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); 

            // Get image from stream...
            Image img = Image.FromStream(fs); 

            // Close/release the file...
            fs.Close();

            // return the image...
            return img;
        }
DdoubleD 315 Posting Shark

No, I want to show the matches, no matter the user types lower case or upper case letters................
I want two things basically, that closest match should display on top and others are below
And
if user enter any number of spaces between characters and numbers in the string , So still in that case it should display the result, It should just consider the entered letters(Any type of Characters), not spaces. It should remove the spaces as getString() function does.
Kindly help me in this................

So, these should all match (and note case diff for P(X)):
Evaluate 2 / 3
evaluate 2/3
evaluate2/3
P(X) = x
P(x)=x
p(X)=X


but, these should not match:
eval 2/3
eval2/3

Is that correct?

DdoubleD 315 Posting Shark

If you have positively verified that the file you can see is named exactly the same as the file you are attempting to load...

Is it possible the file is still locked by a prior call to Image.FromFile? The MSDN documentation does not say what kind of lock is placed on the file (only that it remains locked until the image is disposed), but if there is a write lock then that would explain an exception, but not necessarily the one you are getting...

DdoubleD 315 Posting Shark

hi DdoubleD
Here is my application..........
Kindly help me in this.................

I'm running your app. You removed the code I gave you, modified existing code, but now I'm at a point where I think I know where to make changes to fix this "once and for all".

I have a question: if the user types "eval" instead of "Eval", it will not find any matches--is that how you want it to work, or should that be changed too?

DdoubleD 315 Posting Shark

So does a hundred views but no comments mean I should elaborate on my code more or show more? Maybe I left some key parts out? I'm kinda new at this and didn't want to give too much overhead that was unnecessary since the code is starting to grow. Or does it mean that the code should be working correctly? Even just a quick "What the hell are you doing?" will help me try to clear up the confusion. I'm stuck here and everything I do seems to print the same empty panel.

LOL--I like your attitude.;) There are people in her more graphic oriented than I am, but if they don't jump in by the time I revisit tomorrow, I will dive in... If in the meantime, you come up with a small breakthrough and narrowed down issue related, do post that update..

Cheers!

EDIT: There are people in here from all over the world in different time zones, so it probably won't be much longer before someone jumps in... I'm about to go to bed myself.

DdoubleD 315 Posting Shark

Yeah, I tried some other code with basically the same post data and the result was the same (said not online though I was), yet more verbose...

I started looking into Yahoo API's, but got sidetracked while trying to narrow down this particular function/interface...

DdoubleD 315 Posting Shark

It's not working when I check myself--always enters if (isonval == "00") . My profile is not hidden. Is there another setting I need to check?

DdoubleD 315 Posting Shark

Thanks for your reply Sknake, Well i m using same code which u given to me. But along with that for bringing the result on the top i m using following code:

private void DisplayResults()
    {
      textBoxCurrentPage.Text = curPage.ToString();
      int recStart = 0 + (RECORDS_PER_PAGE * (curPage - 1));
      int recEnd = recStart + RECORDS_PER_PAGE;
      listView1.BeginUpdate();
      listView1.Items.Clear();
      if (currentSearchResults != null)
      {
        for (int i1 = recStart; i1 < recEnd; i1++)
        {
          if (currentSearchResults.Length > i1)
          {
            ListViewItem lvi = listView1.Items.Add(currentSearchResults[i1].FormType.Name);
            lvi.SubItems.Add(currentSearchResults[i1].Caption);
            lvi.Tag = currentSearchResults[i1];
          }
          else
            break;
        }
          // reorder matching search item to be at top
          ReorderItemToTop(textBox1.Text);
      }
      listView1.EndUpdate();
      buttonNext.Enabled = (curPage < maxPage);
      buttonPrev.Enabled = (curPage > 1);
    }
 
    void ReorderItemToTop(string name)
    {
        // sort items so our FindItemWithText finds first closest match index...
        // this will put them in the best order based on ascending...
        // if there is an exact match to name, it will be found first in code below...
        listView1.Sort();
 
        // Locate item beginning with name's text...
        ListViewItem item = listView1.FindItemWithText(name, true, 0, true);
 
        // if found and more than one item, begin moving them up the list....
        // If an exact match was found, it will be put at the top...
        if (item != null && listView1.Items.Count > 1)
        {
            // begin moving matching items up...
            int index = 0; // this is the top where we will put the first/best matching item
            do
            {
                // move item up to next top position...
                item.Remove();
                listView1.Items.Insert(index, item);
 
                // find next item beginning at …
DdoubleD 315 Posting Shark

Here is a crude example I built from that link I gave:

public partial class Form_DataGrid : Form
    {
        DataTable dt;
        DataView dv;
        CurrencyManager CM;

        public Form_DataGrid()
        {
            InitializeComponent();
        }

        private void Form_DataGrid_Load(object sender, EventArgs e)
        {
            dt = BuildDynamicTableArrayExample();
            dv = new DataView(dt);
            dataGrid1.DataSource = dv;

            dv.Sort = "FieldName1"; // sort field required for search (Find)...

            // Initialize CurrencyManager to hold an instance of the form's CurrencyManager.
            // Needed to manipulate the row pointer...
            CM = (CurrencyManager)dataGrid1.BindingContext[dv];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int row = dv.Find(textBox1.Text); // find the text...

            if (row >= 0)
            {
                CM.Position = row; // position the row pointer...
                dataGrid1.Select(row); // if wanting to highlight the row too...
            }
        }
        
        public static DataTable BuildDynamicTableArrayExample()
        {
            // Create new DataTable object...
            DataTable dt = new DataTable();
            dt.TableName = "MyDataTable";   // Optional unless serializing datatables

            // Add some columns to the table...
            dt.Columns.Add(new DataColumn("FieldName1", typeof(string)));
            dt.Columns.Add(new DataColumn("FieldName2", typeof(int)));   
            dt.Columns.Add(new DataColumn("FieldName3", typeof(double)));

            // Optional primary key field specifier...
            dt.Columns["FieldName1"].Unique = true;
            
            // generate some rows of data...
            for (int r = 0; r < 10; r++)
            {
                // create a row object of table object's type defined above
                DataRow dr = dt.NewRow();   

                // Set each column value in the row...
                dr["FieldName1"] = "data " + r;
                dr["FieldName2"] = r;
                dr["FieldName3"] = (double)r;

                // add the row to the table
                dt.Rows.Add(dr); 
            }
            return dt;
        }

    }

EDIT--NOTE: I do not UnSelect(int rowID) any rows and although it will move the row pointer every time, it …

DdoubleD 315 Posting Shark

I believe you can convert the image using the Image.Save method. So, instead of using FileStream:

Image img = Image.FromFile(srcFile); // load tiff
                img.Save(i + ".jpeg", ImageFormat.Jpeg); // save as jpeg

I think will work, but I'm not 100% sure.

DdoubleD 315 Posting Shark

Interesting question...why? Here are a few more I've seen: Logon, Enter/Enter Credentials with Continue or Submit or Enter button...

DdoubleD 315 Posting Shark

Here is an example of searching a DataGrid: How to implement a searchable DataGrid...

To select the row, of course: dataGrid1.Select(int rowId);

DdoubleD 315 Posting Shark

1) Right click on the report, select Insert=>Summary...
2) Select the field you want to sum from the "Choose the field to summarize" combobox and indicate "Sum" in the "Caculate this summary" combobox...

DdoubleD 315 Posting Shark

the error is very clear... assign a value to your course variable eg. string course = "some text"; EIDT: I assume you have no checkbox selections, but by modifying/initializing the course declaration this error should go away...

DdoubleD 315 Posting Shark

When posting to Daniweb, try to be more specific with your question(s). Your post is very vague and doesn't really ask a question. If you have began coding and cannot get something specific to work, post (use CODE tags) the portion of code in question and indicate the error you are getting. If you have a specific question about something you haven't coded yet that you don't know how it's done (not the entire program) and you want to see an example, you can ask that too.

Cheers!

DdoubleD 315 Posting Shark

Given that you already understand that static methods are "class" methods and non-static methods are "instance" methods, when to use them is a matter of preference more than a need to... Usually, you will define instance type methods within your class implementation because you intend to operate on an instance object of the class. Sometimes, there are some good reasons to create static methods though--for example:

Testing the class design:

Suppose you have just coded your class design and you want to test it for bugs. You can create a static method called public static void Test() or something. Inside Test, you could instantiate an object of your class, initialize variables to values that mimick how the class is used, and call each of the instance methods to ensure they are working/bug-free. Of course, you could do this without a static method by instantiating a class object in your form's code or similar, but this might result in placing a bunch of code in your form's implementation that you don't really need for the form, and also require you to run form code that might contain it's own bugs and interfere with isolated testing of your class object. Then, when you are done testing, what will you do with all the test code you wrote? Using static method(s) for testing this way encapsulates unit-testing into the class's design, which makes good sense/practice.

Code/Design Organization:

Suppose you have a class that operates on bitmap or image objects …

DdoubleD 315 Posting Shark

Hi! I am a beginer in C# and I have 2 forms in a project. The first one contains a dataGridview with 3 columns: nr,date and obs and a button. when i select a row and click on a button i want to copy the current nr,date and obs in some textboxes from the second form. how do i refer to thouse from the second form? Can anyone tell me, please? thanks.

One way you could do it is to copy/paste from the Clipboard .

Another way is to directly pass that data to the second form.

What is your usage preference?

DdoubleD 315 Posting Shark

It wasn't clear to me whether your question was for obtaining the state, as you have already been directed, or you are wanting to set the state, which I will throw out some additional direction below.

// ListBox method to select an item...
public void SetSelected(int index, bool value);
public ListBox.SelectedObjectCollection SelectedItems { get; } // to see all items selected...
// and, to capture when the selection is changing:
public event EventHandler SelectedIndexChanged;

// RadioButton method to get/set state:
public bool Checked { get; set; }
// and, to capture when the state has been changed:
public event EventHandler CheckedChanged;

// ComboBox methods to select item:
public override int SelectedIndex { get; set; }
public object SelectedItem { get; set; }
// and, to capture when the selection has changed:
public event EventHandler SelectedIndexChanged;

If you search on these, you should be able to find all the example code you need to see/understand how these are implemented in a form.

Cheers!

DdoubleD 315 Posting Shark

I don't exactly know what you are doing with all this code, but it occurs to me that you save the bitmap to a stream, assign your BitmapBytes byte array from the stream array ( byte[] BitmapBytes = stream.ToArray(); ), then you are trying to copy the bigger (resized) image into the same size BitmapBytes array, which is not allocated large enough. Try resizing it to the larger size ( BitmapBytes = new byte[BMPSize] ) prior to the Marshal.Copy call.

I make no assumptions about what you are doing with all this code, only that the error you are getting is being caused by an attempt to write memory outside the allocated array size.

DdoubleD 315 Posting Shark

Those default namespaces and references, depending on the type of project that is created, are added because the chosen type of application or library requires them. Are you wanting to create a project template that can be chosen like "Windows Form Application", or "Console Application"?

How to: Create Project Templates

DdoubleD 315 Posting Shark

Take a look at all the DataReader loops where you are incrementing numofteams for all of the various list loads...

Without the ability to up and run this project, it's difficult to follow everything that might be happening. What I advise, for starters, is to not rely on numofteams increment as it is currently, and just use the teamsa.Length property for determining the actual number of teams you have loaded into the teamsa string array:

// set the var to be whatever the actual number of teams loaded is...
    int numOfTeams = teamsa.Length;
    // then, assuming number of fixed teams is half the even portion of total teams...
    int numOfFixed = numOfTeams / 2;
DdoubleD 315 Posting Shark

No actually problem is, let i have a form text "evaluate 2/3+5/6", So when user write this string in textbox like this "evaluate 2/3 + 5/6."
So here the difference between both is just spacing difference after 2/3 and before 5/6.
So i want if user enters more spaces or less spaces may be(sometime like this"evaluate2/3+5/6.(there is no space in this string)" So he still get the closest result on top, but the code you gave to me is not doing this. I mean if i write "evaluate 2/3 + 5/6."
So it is not given at top..................
I hope my problem is clear to you........
Kindly help me in this...................

So, for this example you gave, all you need to do is strip those spaces before comparing to list and reordering list:

string s = "evaluate 2/3 + 5/6"; // original text entered by user...
            string sCmpr = s.Substring(0, 9); // retain beginning of string...
            sCmpr += s.Substring(9).Replace(" ", string.Empty); // remove spaces in formula...
            // sCmpr will now look like: "evaluate 2/3+5/6"

then use sCmpr in the call to the void ReorderItemToTop(string name) reordering method I already gave you...

DdoubleD 315 Posting Shark

Hi DdoubleD ,
The code which you have given me is not working properly........
According to your code if the string entered in the textbox exactly matches with the form text
only then it shows that result on top otherwise not.....
Well In my application i match the textbox string with each form text and calculate how much percent it
matches.So is it possible that After finding the percents match for each string collect all the percentages in an
array and then sort them in decreasing order.
In this way the form which matches by maximum perecntage will be on top in all cases.
Can you please tell me how to implement this..........

If I remember correctly, the snippet I gave you reorders the list based on matching the beginning of the text. I believe that I performed a sort on the list first, so it should have began moving up matches to the top beginning with:

1) any exact match it found,
2) any partial string matches at the beginning text.

Is it not doing this?

DdoubleD 315 Posting Shark

The Honor System Virus:
Comes up with this message ...
"Please delete all the files on your hard drive and manually forward
this virus to everyone on your mailing list."

My sympathies/laughs for all those IT people who would actually be asked if user received this, "What should I do?"--LOL, good one!

DdoubleD 315 Posting Shark

So, did you determine the discrepancy in "numofteams" and get the index out of range fixed?

DdoubleD 315 Posting Shark

OK, that error is indicating that home index is out of range because that is line 68 and it did not fail at line 67, which is where we have already ensured that "j" is not out of range because that line did not throw the error:

homea[j] = ""; // line 67 OK
      		homea[j] = teamsa[home]; // line 68 failed

EDIT: What is the value of "numofteams" when this is executing?

DdoubleD 315 Posting Shark

Well, you didn't report whether it was actually "j", and I am still not convinced it is.

In this method,

public void generate_team_array()
	{
		DataComm.CommandText = "SELECT * FROM teams;";
		DataReader = DataComm.ExecuteReader();
		teamsa = new string[numofteams];
		int i = 0;
		string returned;
		while (DataReader.Read()){
			returned = DataReader["Name"].ToString();
			teamsa[i] = returned;
			i++;
		}	
		DataReader.Close();
		numofteamsREAL = i - 1;
	}

why are you setting numofteamsREAL = i - 1 ? Shouldn't it be numofteamsREAL = i ?

It's too difficult to figure this out this way... If you tell me how to get the reference to the Mono.Data.Sqlite namespace, I'll help you figure this out.

The error text you posted is only partially useful and the line numbers it shows have probably moved since the code you posted prior.

DdoubleD 315 Posting Shark

"j" is to big for "homea", "homea" is the right size.

I don't see how "j" can be the culprit since j is always equal to "i" and "i" is always < numofix and homea is sized at numoffix.

Try adding adding this debug statement and assignment before the homea[j] assignment:

System.Diagnostics.Debug.Assert(i == j && j < numoffix && numoffix == homea.Length);
    homea[j] = "";
    homea[j] = teamsa[home];

The assert should happen if the empty string assignment (test) is going to fail...

DdoubleD 315 Posting Shark

"Is this an application that is available for free that you are modifying that we can download the original somewhere and get the 3rd party libraries installed? "
No it's my own app, it is made with Mono & GTK# on Linux instead of .Net

I've installed the Gtk# for .NET (http://www.go-mono.com/mono-downloads/download.html), but I still have one unresolved reference to Mono.Data.Sqlite.

I tried downloading the command-line program Sqlite-3 6 18.zip thinking I could reference the assembly and resolve the above, but no luck. Any suggestions?

DdoubleD 315 Posting Shark

Which index is throwing the error: j or home ?

DdoubleD 315 Posting Shark

Sent you sent me a PM, I took a quick search: http://en.wikipedia.org/wiki/Law_of_cosines

I was then going to suggest that ddanbe is your man for this question, but I see he is already on top of it.;)

DdoubleD 315 Posting Shark

You don't need to use a try/catch block to do this. Capture the TextBox.KeyPress event for each textbox (username/password) to prevent a space character from being entered:

// This event occurs after the KeyDown event and can be used to prevent
        // characters from entering the control.
        
        // Use this to wire the event in the forms constructor or using the VS designer...
        //this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);

        // event handler...
        private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Space)
            {
                // Stop the character from being entered into the control...
                e.Handled = true;
            }
        }

If you want the user to be notified the character is not allowed, you can place a MessageBox call above in the block that handles the space character.

DdoubleD 315 Posting Shark

Maybe my answer is a little too obvious, but if you place the mdb on a machine having a folder that is shared on the LAN, then you only need to have your application browse to the location of the mdb and connect to it there.

DdoubleD 315 Posting Shark

That's great you got it solved. Why not post the finished code (using CODE TAGS) so that when others are searching for an answer to their problem they can find and benefit from your solution?

DdoubleD 315 Posting Shark

This is the second time I've seen this project, which I cannot do anything with because I don't have your 3rd party libraries or data. I've noticed you made a few modifications since the previous thread.

Anyway, these lines look a little suspicious, and "blah" is probably not the best name you could have come up with...

int blah = (numofteams-1) * 2;
		for (int i = 0; i <= blah; i++)

I'm wondering whether you meant for "blah" to be = numofteams * 2 - 1 and for condition to be i < blah ?

Is this an application that is available for free that you are modifying that we can download the original somewhere and get the 3rd party libraries installed?

DdoubleD 315 Posting Shark

You can add any file type you want to a project in VS as far as I know. When you say "import", what do you mean by that?

Your questions might be better suited for the Web Development/ASP.NET forum, but won't know until you explain a little better...

DdoubleD 315 Posting Shark

How many seconds duration is the dss file(s) that is off by 10 - 30 seconds? Also, do you have many dss files of varying durations? If you do, and the calculation varies proportionately to an increase in duration, you could adjust the calculation to accommodate a better approximation.

EDIT: Also, be sure you are not truncating/rounding the time when calculating minutes in the divide by 60 division...

DdoubleD 315 Posting Shark

LOL, I guess there are row headers... I just did the following to test using it and it worked:

private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            dataGridView1.Rows[e.RowIndex].HeaderCell.Value = "Obj " + e.RowIndex;
        }

So, how are you doing it?