|
Thanks, this should help a lot.
You must just be a a better searcher than I.
I'll let you see the finished project, if you want. Probably won't be done (to completion) until about late April though...
There is no knowledge that is not power. - Mortal Kombat
|
|
|
|
|
Hi, i have a application which have a button UPLOAD.
When i press upload, the code behind will create the URI, ftpwebrequest etc etc to establish a connection and does the method.fileupload.
How ever, the application hangs awhile it is being connected to the ftp server. when the connection done and finish uploading, then it unhang.
So issit possible to like when i click the UPLOAD button, it will print to a textbox saying "Uploading in progress.. please wait".
I tried adding this code
tbxoutput.Text = "Uploading in progress.. please wait" BEFORE the creating of URI etc etc. but it still hung..
Do i have to create a thread and put the creating in 1 thread and output text in another?
|
|
|
|
|
|
in the sample in msdn.
it has FtpState state = new FtpState();
but when i try this in my application, it does not seems to have ftpstate
|
|
|
|
|
FtpState is a sample class created in the same document. Scroll up or down and you will find it.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
i dont see any.. i scrol and up down ddint see any sample class
|
|
|
|
|
|
Hi,
Can someone please tell me how can I get the current ID from a table in SQL and incriment that number by 1 using a C# method?
The table looks like this:
Table: Person
Attribute: Id
Attribute: PersonId
Attribute: Person
The Id is auto generated by SQL. I would like C# to look what the current Id is and then incriment it by 1 when inserting the PersonId.
PS - If possible, can I do thisw in my C# code rather than SQL Stored Proc?
Illegal Operation
|
|
|
|
|
Well you would need to issue a Command to the db.
SqlCommand command ...
command.CommantText = "INSERT INTO customer (name, active) VALUES ('test', 1); SET @id=@SCOPE_IDENTITY();";
Would work
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
Illegal Operation wrote: The Id is auto generated by SQL. I would like C# to look what the current Id is and then incriment it by 1 when inserting the PersonId.
You said it does it by itself, AND you want to do it manually?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Please help me that i need to generate an ID(number) with country code(string) while selecting countries from Combo box,i am using only one table with values Country,Id,Name...etc: with OleDBConnection ACCESS,i need number Id's for each country separately,please help me someone as i am a novice in coding
thanks in advance
|
|
|
|
|
Are you saying you want to stop SQL auto incrementing and instead do it yourself? Or, are you saying that you just want to find out what the ID of the previously inserted record was?
If the former, you need to be careful - as if multiple users access the db while you are doing your 'next number' calculation, t may end up trying to insert a duplicate value - much better to let SQL handle that for you.
To get the value of the last inserted identiy, use the SQL function SCOPE_IDENITY(). e.g.
Insert into Person (PersonId, Person) values (@PersonId, @Person);
Select SCOPE_IDENTITY();
then use
int newId = Convert.ToInt32(db.ExecuteScalar(dbCommand));
which will give your program back the ID just inserted.(I'm guessing here that your table has an Id column which is auto-incremented, and a PersonId column which is created somehow else.
(on re-reading this
Illegal Operation wrote: incriment it by 1 when inserting the PersonId.
I'm not sure what you mean by 'inserting the PersonId'?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
its simple,
just create a query (or write a stored procedure which contains)
"select max(Id)+1 from Person"
or
if u want to increment in c#
just select the max(id) from table and
increment the variable by one to generate the new id
|
|
|
|
|
Did I understand correctly that you want to set personid to a number which is +1 from id?
If that's the case, the obvious question is why? However, you can do it for example like this when inserting:
insert into Person (Person) values ('....');
update Person set PersonId=Id+1 where id=SCOPE_IDENTITY()
|
|
|
|
|
I honestly didn't know such a thing existed until i came across it but I saw that it is possible to pull data from a web page in excel and then do whatever you want with it. Is there any way to do this in c#?
|
|
|
|
|
Take a look at the WebClient class and the Download* methods.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi to all!
I'm having a problem while trying to make gsm calls with my Westermo GDW-11 Modem. After making the first call to a number, i'm trying to make a call to another phone number. But i can't do it, because i can't hang up correctly. My DTR Line is always connected, even after using SerialPort dispose, setting DTREnable to false... and sending +++ and ATH commands to it... Anyone could help me with this? Is there any kind of documentation regarding the good way of making more than one gsm call sequentialy? My project deadline is approaching and this point is crutial.
Best regards.
|
|
|
|
|
I just found that WPF is great and it can make very smart tool, it is sth like HTML, is it easy to learn and use?
|
|
|
|
|
WPF uses XML markup, so the syntax reminds of HTML, but there the similarities pretty much end. It's the new version of windows forms, and it contains everything from the start that the old windows forms controls has been expanded with over the years. And then some...
I find it quite easy to learn and work with. The new model for layout makes it easy to do things that you before needed to stack panels into panels to be able to accomplish.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If you are familiar with c# win forms then you need to change your approach. The WPF it's diffrent story.
|
|
|
|
|
hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system?
Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution
Thanks!
|
|
|
|
|
You could use System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size .
|
|
|
|
|
That will get the bounds of the screen at its current resolution...but will it get the bounds of the screen at its native resolution? For example, if I have a 1920x1080 screen, but I am running it at 1600x1200...the ratio of 1600x1200 is a 4:3 ratio, but the screen itself is a 16:9 ratio. There is also the question of a screen with 1920x1200/2560x1600, which are both 16:10. I am not sure the .Bounds property will actually provide the right information.
|
|
|
|
|
|
Thanks for the reply, but the method returns the Windows resolution.
I'm looking for the *real* *physical* *native* resolution of the LCD display, the number of real pixels that the display is made of.
Eg. i need to know if the display is a 1280x800 or a 1280x1024, independently from the screen resolution currently setted in Windows.
I think that it is possible to read that value, since Windows itself can: actually, it does so the very first time you attach a different LCD display and Windows (XP) says "the screen now will be adjusted for a better visualization".
|
|
|
|