|
Hello everyone,
1.
I have checked MSDN document,
http://msdn2.microsoft.com/en-us/library/kzy257t0(VS.80).aspx
it does not cover what is the function of WaitOne if we assign 0 as the timeout parameter.
I think the function of assigning 0 is to check whether the signal is set or not, and it will be returned immediately, right?
2.
If WaitOne (0, true) returns true, it means the signal is set or not set?
thanks in advance,
George
|
|
|
|
|
Hi
iam in windows application using c#.
my database is "FireBird Database".
Database path is :
string dsRelativePath = "database\\absolutemedia.fdb";
string dsAbsolutePath = Path.GetFullPath(dsRelativePath);
string ConnectionString = "ServerType=1;User=SYSDBA;Password=masterkey;Database=" +dsAbsolutePath;
This path is working fine upto now..
but in my application, i have an option to upload images from local drives..iam browisng an image thru "OpenFileDialog".. after selecting an image .when iam going to save ,
database path i,e dsAbsolutePath is changed to image path.it's giving error in database connection...
please reply where the problem is ?
how can i rectify this .
murali krishna
|
|
|
|
|
I think u are setting the image path in dsRelativePath after the image is selected...check that ...if so store the path in different variable
.....
|
|
|
|
|
Hi,
Thanks for Reply..
Here iam not setting ImagePath to "dsAbsolutePath";
iam taking Imagepath to another string.
murali krishna
|
|
|
|
|
i don't understand how come image path value is taken in dsAbsolutePath without setting it ...declare the dsAbsolutePath and dsRelativePath variables as constants and see if the error still occurs..can u post your code ?
.....
|
|
|
|
|
Dear all,
Can anyone help me to do bandwidth programming in C# 2003? If anyone aware of this kindly, forward me source code of sample project and also your mail id. So, I could contact you later as if I've doubt on that
|
|
|
|
|
Have you tried searching Google? There are a few articles here on CodeProject as well. Guys here don't like giving code without you doing your bit and showing what you have done. Treat Google as your friend.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hello everyone,
1.
When we close the HTTPListenerResponse.OutputStreram (using Close method, when complete writing content from server side), I think in the internal of CLR, there should be some flush work during Close method (I do not think each time when we write to the stream, data will be flushed immediately).
But the return type of Close is void and there is no exception thrown from Close from MSDN document for Close method, if Close fail, and means data is corrupted -- flush of data failed. How could we detect this situation?
2.
Any best practices to solve the issue when program server side code?
thanks in advance,
George
|
|
|
|
|
I am working on my senior project and I am using C#.net and Microsoft Access to create a program that lets the user store information into a database. I have many tables but the primary table that mostly everything connects to is the customers table. Well I know how to insert, update and delete using C#. But I need to know how to retrieve the primary key from the customers table which happens to be an autonumber. I kind of understand that I need to use SCOPE_IDENTITY or @@IDENTITY. I just have no idea how. I have tried a couple ways without any success. The reason I need the primary key of this table is that I need it to be able to insert more data into other tables.
|
|
|
|
|
Is it necessary for you to have an autonumber field as a key in your table ? if not, u can write ur own code for auto-incrementing the id and for this, u can modify ur database and change the key field to a normal id. As far as i think auto-number fields are generated automatically when u insert the record, but u certainly can retrieve the id for viewing purpose.
|
|
|
|
|
|
Hi,
I am using streatchblt() and SetStretchBltMode() functions of unmanaged code in C# for printing image. For doing that I am calling the external gdi32.dll (form windows folder) file.
I am new in doing this sort of platform invoke operation. Plz tell me if my software is run in any windows version ranges form windows 95 to vista or any upcoming version, will this be problematic?
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]<br />
<br />
static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest, int nYOriginDest,int nWidthDest, int nHeightDest, IntPtr hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, Int32 dwRop);<br />
<br />
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]<br />
<br />
static extern bool SetStretchBltMode(IntPtr hdc, int iStretchMode);
>> I have tried to add this dll file as a reference in my code but failed to do so as this file is unaccessible.
Plz tell me if I have any alternative for doing the work of the above mensioned functions with managed code.
thanks in advance
Faysal
|
|
|
|
|
No, StretchBlt has been there forever. Goodness knows why you're using it tho. You can set the draw mode of GDI+ stretch drawing in C#.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
As far as I know there is no function like stretchblt() or SetStretchBltMode() in C#. And if I try to change the resolution of my image according to my printer's device context then it gets too slow without showing any apperant change in the print quality.
Plz tell me if you know about any such function in C# or any other way to obtain a better print out quality of image in C#. (I really want to avoid unmanaged code in C#)
Faysal
|
|
|
|
|
The Graphics object has DrawImage, most of hte overloads let you resize the image.
There are overloads that take an ImageAttributes object, you either set the stretch mode there, or there's a property on the Graphics object to set the stretch mode.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi im trying to remove an element from a single dimension array and i heard the only way to do this is sort of a wrap around, but im not to sure on how to approach this. I know its easy using Array Lists but i cant use that for what i am trying to do, any help would be appreciated
|
|
|
|
|
What? So like:
1
2
3
4
5
and you remove '2' and end up with
1
3
4
5
null
?
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Why wouldn't a List work?
|
|
|
|
|
im not saying that a list wouldn't work but for what im doing i can only do the array
|
|
|
|
|
My question still stands, why can't you use a List? A list is basically a array whose size can change. You can add arrays to the list and turn the list into an array.
|
|
|
|
|
You can't change the size of an array. You have to create a new array and copy the items that you want to keep from the old array.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
when creating a data base in a c# application from the solution it self, there be a data set generated with it , it contains three files one of them is .xsc and other is .xss
I was wonder if there are some tutorials to learn how possible can I get benefit of that ,
and I need to learn what are the possible connection string format for the data base
thanks in advance
There is always something to learn
|
|
|
|
|
Again with the sockets jordan?! Yep. On the host end I have a List of sockets:
<br />
List <socket> sockets = new List <socket> ();<br />
Now when I get the "OnAccept" callback I add the new socket to the list mentionned above*. When the host closes the form, I iterate through each Socket in the list. What I want to know is how to disconnect and shutdown a socket properly, as well as for the Client. The client has only one socket.
There is Socket.Disconnect (bool reuse), Socket.Shutdown (SocketShutdown how) and Socket.Close () and I'm confused what I'm supposed to use and in what order. I suspect all three in the order that I mentionned.
*
<br />
private void OnAccept (IAsyncResult ar)<br />
{<br />
Socket new_socket = connection_starter.EndAccept (ar);<br />
sockets.Add (new_socket);<br />
<br />
connection_starter.BeginAccept(whatever, null, void, foo, bar);<br />
}<br />
Thanks.
modified on Wednesday, April 23, 2008 4:32 PM
|
|
|
|
|
|
Yay I'm not get SocketExceptions anymore! Thanks.
|
|
|
|