|
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".
|
|
|
|
|
I'm not sure about it but I think that earlier Windows versions may not see the native resolution. The display driver used sees it, but that wold be driver specific.
However did you notice the post I replied to Jon Rista? Vista has a new WMI class definition to get the maximum sizes.
|
|
|
|
|
DirectX lets you enumerate valid display modes (see EnumDisplayModes[^]). Chances are that the highest one will be the native resolution - but I can't guarantee that.
|
|
|
|
|
Why would you want it to adapt to the screen and not the resolution? It will look stretched/smashed if you try to do that...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
This is the interesting point
The user will not have access to Windows settings (mandatory design).
If he would attach a non-4:3 LCD to the machine, and Windows shouldn't adapt automatically to the native resolution, I should instead.
I agree that is a driver matter. Thanks for the replies.
|
|
|
|
|
I try to do following:
RegistryKey RegKey = Registry.ClassesRoot.CreateSubKey(".xxx");
but it gives the message "the access of registry key "HKEY_CLASSES_ROOT\.xxx" is denied",
what does mean?
thanks
|
|
|
|
|
It means you don't have access to that registry key. I was able to figure that out by reading this...
Seraph_summer wrote: "the access of registry key "HKEY_CLASSES_ROOT\.xxx" is denied"
|
|
|
|
|
It is most likely a permissions issue. Review the permissions on the registry key and hive.
|
|
|
|
|
I have known the problem, because I am using vista and I have to run VS as administrator!!
|
|
|
|
|
Hello,
I'm using the serial port control from .net 2.0 and an usb to serial(3 wires configuration) converter in order to communicate with a logic analyzer. The device makes a print screen, and I query it to send it over serial to my pc. If the image displayed on the device contains more information, such as fonts and various colors, I have some problems. Here is my scenario:
-The device sends the image in pcl format.
-I receive the bytes in the datareceived event and write them with a binary writer on to the disk. I've tried writing each time the event fired, as well as setting a threshold of 50000 (the image is about 30000) and a timer (I thought the operation with the disk made me lose some data) in order to write the entire buffer, after the transfer is made.
-I can appreciate if the data is correct by using a pcl to image converter, which displays the original image.
-For certain images, the converter fails to display the source, in that parses the image on 2 pages, an it displays a string of characters that it couldn't interpret from the file. (it displays it on the image).
-I know that the image is sent correctly because I used matlab to make the transfer, and it got the image ok.
-i've started modifying this solution:
http://msmvps.com/blogs/coad/archive/2005/03/23/SerialPort-_2800_RS_2D00_232-Serial-COM-Port_2900_-in-C_2300_-.NET.aspx[^]
I've read there are some problems with the serial port control, and used this to avoid it:
http://msdn.microsoft.com/en-us/magazine/cc301786.aspx[^].
I've written a small c program, which I wanted to include in my c# code, it sends the command, but when I poll portAddress + 5(the status register), it returns 0 or 0x60, but never a 0x01.
I've written a c++ (createfile,readfile) to communicate with the device, the device does not respond.
Yes,this is a school project, yes I'm on a tight schedule and i really need some help. Thank you.
P.S.I'm not doing it in matlab, because I want to continue extending the program in order to provide a virtual lab, accessible via internet.
For code requests, situations I have missed to ilustrate, please ask and debate.
My later edit: the pc sees the serial port on com12, due to the adapter and it seems that in c++ i have to write \\\\.\\com12 if com>10 as parameter for createfile. In c#, getports() return the com12 though.
Cosmin.
modified on Tuesday, February 3, 2009 2:19 PM
|
|
|
|
|
I've solved the problem. I found out that the issue was in the protocol I was using. As I've said before, I was using a 3 wire serial setup for communicating, and the device accepted xonxoff protocol or none. I thought it was best to use xonxoff, but it seems that the pc misinterprets some characters and I changed it over to none. Although there's no control over the communication, the image is sent correctly now.
Cosmin.
|
|
|
|
|
private delegate void _Post_Result(object[] data);
private void Post_Result(object[] data)
{
if (lvThreads.InvokeRequired)
{
_Post_Result upd = new _Post_Result(Post_Result);
this.lvThreads.Invoke(upd, new object[] { data });
}
else
{
ListViewItem lvitem = (ListViewItem)data[0];
this.lvThreads.Items[lvitem.Text].SubItems[1].Text = Convert.ToString(data[1]);
}
}
I am getting this error "Parameter count mismatch" in the bold line...
|
|
|
|
|
don234564 wrote: Parameter count mismatch
The error message always tells you the problem.
In this case, the number of parameters passed to the method is incorrect.
I don't know that method you're using, though, so I can't help you with that.
Kristian Sixhoej
"You can't undo the past... but you can certainly not repeat it." - Bruce Willis
|
|
|
|
|
Looks alright to me, I have to say. What is lvThreads?
Regards,
Rob Philpott.
|
|
|
|