|
Hey, I actually did a little searching on that function and I found an example of it being used. The example is a bit different than what you want but I can modify it so that it will work for you Do you want me to do this and post the code? Or do you have it working now?
|
|
|
|
|
To be honest man i haven't been able to use the page you posted. Last night i did however read the MSDN documentation on it. But I didn't have too much time last night to work on it because it was busy at work. If you'd like you can still post the example. I'm still going to check the page you posted and see what i can come up with also. That way i'll be able to learn what is actually going on!
After i get this project completed I'm going to send you the source of this project. You've helped me out alot with it! I might also put it up on sourceforge.net. But beware it is REAL newb code . I've just been working on a small project so i can get some hands on while i read the "Microsoft C# Step By Step".
Peace
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Yeah to be honest I like to know whats going on with my code too. I'll try and get a file copy thing going with that function and will post some examples with some comments to walk you thought what it is doing.
Sounds good I'd like to see it when it's done. Don't worry if your code is a bit inefficient (it can't look worse than the first program I wrote ). Every project you do you gain experience and pick up some knowledge of how to do something new
|
|
|
|
|
Whats up man. I tried working with the page you sent me but i couldn't get it working. It was giving me punctuation errors like ";" at the end of every line. i'm pretty sure i am just not using it right . I was browsing msdn and i came across DllImportAttribute Class[^]. I'm going to work on it again today and see what i can come up with.
Peace
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Yup the DllImport is what you need to get the method I have thrown together a small example for using this function. I can send you the source code for the project (posting too much code makes it confusing). What version of visual studio are you using?
|
|
|
|
|
I am using visual studio 2005. Thanks again for all the for all the help man! Once i get to work tommorow i will send you the source.;)
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi.
I need a sample code that using socket I can in one application write a stream on a port and in another application on another machine can read that stream.
You soppose that these two machines are connected to each other using LAN.
Best wishes
|
|
|
|
|
Well if you can't find sample socket code on the internet you didn't look! There are more socket code samples on the internet than just about anything else and that problably includes porn.
sockets.com[^]
led mike
|
|
|
|
|
|
Can anybody help me to know how to send emails using C#.NET v1.0. Please provide me necessary coding to perform this.
I am a student
|
|
|
|
|
|
http://dotnetopenmail.sourceforge.net/faq.html
Above link is to open source C# library for sending e-mails with attachments, as HTML, Text, etc.
It works fine in .NET 2.0, and I can't find anything on SourceForge or the home site above that says it DOES NOT WORK on 1.1, or 1.0, but if you have any doubt go to the Forums on the page linked to above and post a message.
best, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
|
|
|
|
Hi all. My C# app registers itself using the IStillImage interface, and the RegisterLaunchApplication method, such that when we connect a camera, our program is listed in the box that comes up, and from there we can run the software. Recently, it's become the case that launching the app this way causes it to freeze, although running it normally never does. There are no parameters passed through, nothing should run any different to if I double click on the app. What happens is, it shows a second thread in task manager, which, if you go to the process, goes to explorer.exe. This thread is the only one not responding at first, then the other one also dies, and Windows informs you that you need to close the app, etc. There is definately no visible UI to go along with the other thread.
Any suggestions are most welcome.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ThreadingApartment?
|
|
|
|
|
Hello,
With following code i can filter (with the GetSodas sql-query) data out of my database, and get the total of records which can be found.
int totaal = aanbodTableAdapter.CountSodas().Value;
So far so good.
Now, I want to get 1 single record (which i filter by the id) out of the GetSodas-query.
I tried this:
button1.Text = aanbodTableAdapter.GetSodas().FindByid(1).description;
But I get an error:
<br />
System.NullReferenceException was unhandled<br />
Message="Object reference not set to an instance of an object."<br />
What do I do wrong?
Thanks!
|
|
|
|
|
Well, you should first break this down so each call is on a new line. Then work out where you're getting null, and you can try to fix it from there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't really know what you are trying to say ..
I know exactly where I get the error (as said in first post), but I can't fix it ..
|
|
|
|
|
JelleM wrote: know exactly where I get the error
No, you do not.
button1.Text = aanbodTableAdapter.GetSodas().FindByid(1).description;
button1 could be null. There's two method calls and a property call, each of which could fail due to a null reference. So, you need to call GetSodas, place the result in a variable. Then use that to call Findbyid. Then, access the description property. FindByid would be my guess, but it's best not to guess, make sure, then you know where to look.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yeah idd, I thought you were talking about where in the code
I tried:
<br />
button1.Text = aanbodTableAdapter.GetSodas().ToString();
button1.Text = aanbodTableAdapter.GetSodas().Count.ToString();
So the problem is in the findbyid ..
I tried different id's also (0,9, ..), but always that error :s
Can you help?
Tnx!
-- modified at 17:38 Thursday 4th May, 2006
|
|
|
|
|
OK, so it's the call to get by ID. Now, how is all of this hanging together ? You said 'SQL question', have you written any SQL anywhere ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Except from the queries I made: No.
But because it's about retreiving data from the database, i named the title that way ..
I don't know what findbyid really does (which id?), the thing is I don't find a similar function in the list that also gets one single row out of the query ...
|
|
|
|
|
|
I don't really know what you are trying to say.
I just want to "filter" one single row out of multiple rows.
int total = aanbodTableAdapter.GetSodas().Count // total = f.e. 21
I got to find a way how to reduce the 21 results (rows) in the above code, to 1 single (specific) row?
|
|
|
|
|
Are you looking to get a specific row by a primary key, or a specific row by value? From what I see, it appears that aanbodTableAdapter has no ID field of "1". The FindBy* is generated by a dataset(I'm assuming you're using one), and the * is the primary key(or keys) of the table. If the primary key doesn't exist, the findby will return null, so preforming any operations on a null datarow will fail.
Try debugging and set a breakpoint right before you make that call to check the state of your tableadapter to make sure its A) Filled, and B) has an ID key of the value you think it should.
|
|
|
|
|
Hey Drew,
Sorry for the late response.
It doesn't really matter, it's the goal to put the "function" in a loop and the loop just has to assign all "description"-values to the different buttons-Text-value(so it can be another method, I don't care, something like I suggested seemed the most logical to me).
Thanks!
-- modified at 4:55 Tuesday 9th May, 2006
|
|
|
|