|
FYI, you misattributed that quote... I wrote that.
Som Shekhar wrote: add buttons to scroll page up or down
That is what the PAGE UP/PAGE DOWN buttons would do. It would be, however, quite slow when paging 5,000 lines or so.
Som Shekhar wrote: Instead of adding ScrollBars
Why not have both ScrollBars and PAGE UP/PAGE DOWN functionality?
|
|
|
|
|
Well, I was thinking of having 5+ string builder objects.
1 for current text in textbox
1 for next page
1 for previous page
1 for 5000 lines ahead page
1 for 5000 lines behind page
you can add more if you wish in the same way.
You need to maintain few indexes in your program to read only those blocks using StringBuilder.ReadBlock method.
Searching is something I am not sure of.
|
|
|
|
|
The problem is not the buffer... the speed issue is from the user... it will take many pages before they traverse 5,000 lines of text. The text can be loaded from the file on-demand without the user noticing. The trick is to reduce the amount the user must interact with the UI.
|
|
|
|
|
Now, this confuses me. What exactly is your question then?
Reading your question, it sounded like displaying it in Textbox is the problem.
Are you talking about Search? or some other thing?
|
|
|
|
|
I am not the one with the question. Look at my username. I was merely correcting you.
|
|
|
|
|
HA HA HA... This was funny... I am so sorry!!!!! HA HA HA...
Now I see, I misquoted you, Misunderstood you and everything... just because you replied me first... Sorry Buddy.
|
|
|
|
|
aspdotnetdev wrote: The trick is to reduce the amount the user must interact with the UI.
this is where we agree.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
hiwave is a external .exe, and it has a Component Object Model (COM) interface.
I add a COM reference of hiwave library in my C#.
When use "HiwaveLib.Hiwave aaa = new HiwaveLib.HiwaveClass();", I can get a new instance of hiwave and control it.
But I want to realize below function:
first, user run the hiwave, and then my C# connects to this existent hiwave instance through COM interface and control it.
What should I do?
Thanks
|
|
|
|
|
You haven't provided enough details to narrow down an answer.
Has this existing instance been created inside your own app, or was it created in another app? Did you write this other app or is it a "off-the-shelf" piece of software? Does the object you're trying to use have built in singleton support?
|
|
|
|
|
The existing instance is created in another app. My own app want to control the existing instance.
This other app is a "off-the-shelf" software.
|
|
|
|
|
Then you're very limited in what you can do.
If the COM object that app creates is a singleton AND is exposed to the rest of the system, then you can probably use the Activator.GetObject() method to get at the instance of the COM object (you still need to import the COM object in your project references.) If not, you're pretty much SOL.
|
|
|
|
|
I received the following error (see line *********error***********) when trying to transfer data from excel to sql using the code below. The sql table is in the database and columns all match the store procedure, does anyone have any idea what creates this problem.
Thanks in advance, Michael
Failed to obtain column collation information for the destination table. If the table is not in the current database the name must be qualified using the database name (e.g. [mydb]..[mytable](e.g. [mydb]..[mytable]); this also applies to temporary-tables (e.g. #mytable would be specified as tempdb..#mytable).
void ExcelToSqlBulkCopy(String strPath, String strFile, String strTableName)
{
strExcelStoredProcedure = "SELECT ID,City,State FROM [Cities$]";
String excelConnectionString = y;
String sqlConnectionString = z;
// Create Connection to Excel Workbook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
OleDbCommand command = new OleDbCommand(strExcelStoredProcedure, connection);
connection.Open();
// Create DbDataReader to Data Worksheet
using (DbDataReader dr = command.ExecuteReader())
{
// Bulk Copy to SQL Server
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "[MyDatabase].[dbo].[" + strTableName + "]";
bulkCopy.WriteToServer(dr); *********error***********
}
}
connection.Close();
}
}
|
|
|
|
|
I never use a data reader so how do you inspect the contents of a datareader to check that the info in it is correct before you try to bulk copy.
I would change the datareader to a datatable and inspect the contents before the bulkcopy statement comparing the columns and the datatypes, excel is a crappy data source! Collation makes me suspect unicode or suspect characters in the data.Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am into a 3D simulation project where I need to subtract a 3D model from another (repeatedly fast). I am using OpenGL and STL-files. Can anyone give me a suggestion of what to use? My dream is to find something that I could use call from C#. Or maybe can help me code it? I am a student so I cant afford to buy anything fancy, so if there is anything free I would love to hear about it.
|
|
|
|
|
I'm not sure what you mean by "subtract a 3D model from another (repeatedly fast)", but XNA is pretty much the standard for doing 3D type work with C# (usually relating to video games).
|
|
|
|
|
Thanks. It is for a machine simulator where I need to run a mill (a cylinder with flat or ball edge at the bottom) through a workpiece. Each time the mill moves it needs to erase the material that it touches, making a track in the material. So I more or less need to say subtract(myWorkPiece, myMill). That is called 3D boolean operations, do you know if XNA can do that?
|
|
|
|
|
That is more like a feature you'd find in a fully functional 3D design program, not in XNA. You'd have to build that feature yourself, but XNA could help I'm sure.
|
|
|
|
|
This is not a simple problem. There are some open-source packages for doing solid modeling, but they require a lot of work and you will have to link to these non-managed code libraries (written in C, not dot-net) in order to use them in C#. The most well known is http://www.opencascade.org/ but there are others. Search for "solid modeling" and "free library" or "open source" to find them. I wish you a lot of luck.
|
|
|
|
|
Thank you! I suspected it was going to be hard, I dont even dare to think of figuring out myself. I will check out your suggestions, still hoping I will be able to find a solution.
|
|
|
|
|
Hi,
Below is the code to create a 3 x 3 matrix with the vector (A system of linear equstions)
2x+ y -z = 8
-3x -3y +2z = -11
-2x +y + 2z = -3
The method works fine and displays the solution. Instead of typing in the numbers for the 3 x 3 matrix I would like to create a method for an arbitrary n x n matrix with data in an excel file. For example I would like to do the operations on a file that is 50 x 50 in an excel file. ( iguess I could type in all 2500 values but that would be stupid even for a C# newbie. What would be the code to perform such an operation?
static void TestGaussJordan()
{
LinearSystem ls = new LinearSystem();
MatrixR A = new MatrixR(new double[3, 3] { { 2, 1, -1 }, { -3, -1, 2 }, { -2, 1, 2 } });
Console.WriteLine(" Matrix is \n " + A);
VectorR b = new VectorR(new double[3] { 8, -11, -3 });
Console.WriteLine(" Vector b is \n " + b);
VectorR x = ls.GaussJordan(A, b);
Console.WriteLine("Solution x=\n" + x)
|
|
|
|
|
It would go something like this:
double[,] FillMatrix(int wide, int tall)
{
double[,] matrix = new double[wide, tall];
for(int x = 0; x < wide; x++)
{
for(int y = 0; y < tall; y++)
{
matrix[x, y] = GetValue(x, y);
}
}
return matrix;
}
double GetValue(int x, int y)
{
}
If it must come from an Excel file, I can't help you as I don't know much about that. However, you could export it to a CSV format and then parse that text file if that is an option.
|
|
|
|
|
|
By the way, I just noticed that your title doesn't relate to your question at all.
|
|
|
|
|
Hello
I was trying to use a Clip to define the drawing area on a graphic
Let says that I'm woking with a Graphics on a page : bound 0,0,1200,1800
I define a clip at 100,100,700,900
So the clipBound is 100,100,700,900
I was expecting that if I draw something at 0,0 on that graphics it will be 0,0 on my clip so 100,100 on my page
But it remain 0,0 on the page
So my question is : What is the use of a clip ? Is it really usefull for some purpose ?
Thank for your help
|
|
|
|
|
Ummm, according to the documentation a Clip "gets or sets a Region that limits the drawing region of this Graphics."
Why would you think it translates coordinates?CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|