|
t4urean wrote: unc
C++/CLI is far faster than using dllimport (which is part of P/Invoke). If you read Nish's article linked above, you could see the performance results yourself.
|
|
|
|
|
Hey, I’m trying to search for an ID and get the results from two tables as you can see in the below code.
The problem is that the fields that I save in dataset are from two tables but what can I do about datasource for my DatagrideVeiw there is no specific table ??!!
And when I use this code
dataGridView1.DataSource = myDS;
It doesn’t show anything !!!
string cmd = "SELECT UniversityDB.ID, UniversityDB.UniID, UniversityDB.UniCode, UniversityDB.UniName, UniversityDB.UniAddress, UniversityDB.UniDetail, UniMajorDB.Major, UniMajorDB.Level " + <br />
"FROM UniversityDB INNER JOIN UniMajorDB ON UniversityDB.UniCode = UniMajorDB.UniCode = '" + UniCode_tb.Text + "'"; <br />
<br />
MyAd.SelectCommand = new OleDbCommand(cmd, MyConn); <br />
MyAd.Fill(myDS); <br />
dataGridView1.DataSource = myDS.Tables[TableName];
can you help me out or if there is another way to show the results in DataGridView please let me know.
Thanx
Mr.K
|
|
|
|
|
mrkeivan wrote: dataGridView1.DataSource = myDS.Tables[TableName];
And finally you should call:
dataGridView1.DataBind();
|
|
|
|
|
I did that but i had this error
System.Windows.Forms.DataGridView' does not contain a definition for DataBind
what is this Databind ? what does it do ?
and the thing is that there is no table, I get the fields from two diffrent table, so what should i replace tableName with ??
Mr.K
|
|
|
|
|
Hi,
My first post here so I hope it is in the right place.
Here it goes:
Lets say I have two bitmaps. One of them is smaller than the other.
Now I want to find out if the smaller bitmap occurs somewhere "inside" the other bitmap.
How am I going to do that? I cant be to demanding, because I want some speed...
I have tried filling arrays with the bitmaps color-values and then comparing them pixel by pixel. Cant seem to get it to work properly...(maybe someone could show some code?)
Im getting very annoyed by this.
Thanks for any help. I need it.
HjalleBK
|
|
|
|
|
There are many algorithms out there for bitmap matching. The solutions generally are not trivial.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Yeah I have found a lot of those, but there is a big difference betweeb comparing two bitmaps and finding a bitmap inside another, but maybe its just me being stupid.
HjalleBK
|
|
|
|
|
Yes, matching partial bitmaps is very different to comparing two bitmaps. As I said there are a lot of algorithms out there to do this.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
It would be nice if you could direct me to some of them... I find it hard to find them...
HjalleBK
|
|
|
|
|
It may help you to look for Template Matching.
Boyer-Moore, Rabin-Karp, Knuth-Morris-Pratt algorithms. Will provide almost exact matching capabilities. Wikipedia is a good source of information:
http://en.wikipedia.org[^]
I have read about pattern matching out of interest. The subject is huge, I have not written any code personally so I can not share any with you.
Hope this helps.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
How do I communicate with a USB device.... in my C# code to read data.
Its a USB Radio Receiver WiNRADiO WR-G303e ...
It gives digitized RF signal.. which i have to read and display as a graph.
All this is to be done in Real time. I mean it will be continuous streaming
|
|
|
|
|
|
Does anyone have an example of how to read the Height and Width of a JPG file using .NET and c# BUT without loading the image into memory?
I have seen examples in C++ but have failed to translate the code. I know I need to read the binary file stream and look for the headers but have still got problems doing this.
Any help would be much appreciated.
Regards
Richard
|
|
|
|
|
Hi all, i have to put all my assemblyes into a subdirectory of my projects, it is possible for my program to call the assemblyes that i use into a different location than the root of my project?
Thanks all
|
|
|
|
|
peppepinna wrote: it is possible for my program to call the assemblyes that i use into a different location than the root of my project?
Yes. it's possible.
Try this code:
<br />
Assembly asm = Assembly.LoadFrom(filename);<br />
Type[] types = new Type[0];<br />
types = asm.GetTypes();<br />
<br />
foreach (Type t in types)<br />
{<br />
if (t.FullName == "SomeType")<br />
{<br />
object obj = Activator.CreateInstance(t);<br />
}<br />
}<br />
|
|
|
|
|
Hi there.
I am wondering how does one use another application in an application that one is writing.
Let´s say I am writing a program, A, and when a button is clicked it needs the functionality of another program, B. How does one go about making program A use program B when needed.
Any help is greatly appreciated and short examples even more appreciated.
Thanks,
F
|
|
|
|
|
It really depends on what you are trying to do. Here are two possible solutions:
- Break the needed features into a component library that both applications can share. If this is possible, this is preferable.
- Another approach might be to spawn a new process to run the application, but communication between the two applications is some what limited.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessClassTopic.asp
Beyond those general (and very different) approaches I'd need more information about what your trying todo.
Hope this helps
Marc L
|
|
|
|
|
Thanks for your answer.
When the user presses a button several things need to happen one of which is using a program (I have that one) that converts a .tiff file to a .pdf file and stores it in a folder of the users choosing (I had a TreeView in mind to let the user select a directory).
Also, can you elaborate a little on the two solutions you suggested?
Many thanks,
F
|
|
|
|
|
Sure, the different approaches are based on whether the .tiff to .pdf converter program can be used inside your application or do you need to 'run' the other application.
1)Ideally what you want is the .tiff to .pdf conversion to be done by an object in your application.
So if you can create/add a reference in your project to the converter program, what do you get? If the reference is created you can browse the exposed objects. Right click on the reference (in the solution explorer) to bring up the object browser (Visual Studio 2003). Then you have the task of understanding what objects to use and what they'll do for you. (Hopefully there's documentation)
2) If the other application can't be used as a reference then you will need to 'run' it outside your application. Use the link from the previous post to review how you can write code to run the application in a new process.
Hopefully the converter program takes commandline input that can be set in the StartInfo.Arguements property.
Hope that helps
Marc L
|
|
|
|
|
Hi,
I have a question about config files. I have the following in my application..
1. ASP.NET web application with a web.config
2. C# class library (BL and DAL) with an App.config
3. Two windows Console Applications with their own App.Config.
Now I try to retrieve a value in the DAL using this code.
<pre>
string str = ConfigurationSettings.AppSettings.Get("Value");
</pre>
This code works fine when the windows applications are running. But when the Webapplication is running and invokes an method in the Data Access layer, the piece of code tries to refer to the Web.Config instead of its own app.config even though it is in the DAL. Is there any code that will tell DAL to refer to its own config file?
Can anyone tell me if I can do what i trying to do and if yes what changes do I need to make to my code for it to work?.
I do need the app.config at the DAL level as there are some settings common to both the windows as well as web application and that is the best place to put it.
Help Please,
Thanks Kalyan
|
|
|
|
|
You need to add everything to the web.config, unless the DAL perhaps looks in some other place, like Gentle.NET does.
|
|
|
|
|
Hi I am not quite sure what you mean by Gentle.net. I will be more specific if that helps.
Example: The sql server path is stored in the app.config of the DAL. It needs to be there because both the webapplication and the windows console application needs access to the DB. But when the webapplication runs the DAL ignores its own app.config and looks in the web.config thus breaking my code.
I am assuming the web.config overrides anyother config files in the projects or assemblies the webapplication references. I need to know how to configure that or where do i put my common stuff.
Thanks.
|
|
|
|
|
How to determine have AxWebBrowser current selection or no?
I need in this for popup menu.
|
|
|
|
|
I have created a c# project using microsoft visual .net. I am trying to change an image on a page, so when the user clicks a button the image changes depending on the outcome and the same happens when the user types in a textbox. What code can I use to do this????
Thanks
|
|
|
|
|
With the button is the Click event and with the textbox use the OnTextChanged event.
|
|
|
|