|
Hello,
This is the first time I've posted anything, but I'd like to thank everyone for all the wonderful infos they have posted. I realy have learned a lot.
I am working on a program that has been modified from Brian Nash's "Compact Framework Movie Collection Manager". He (and I) uses SQL Server CE and C#, but I would like to add an image to the database. Basically, all I want to accomplish is that an image is displayed for a particular "Movie ID."
I searched on the internet and found the following snippet:
1. Create Database - did that -- no problem.
2. Create Table using ExecuteNonQuery()
string sqlCreateImageTable = "CREATE TABLE Photos (photoID int IDENTITY (1, 1) NOT NULL,"
+ "name nvarchar(50) NULL, photo image NULL)";
Added this, no problem (no errors)
3. Read bytes of Image from FileStream
FileStream fs = new FileStream(photoPath, FileMode.Open);
int photoLength = (int)fs.Length;
byte[] photoBytes = new byte[photoLength];
int n = fs.Read(photoBytes, 0, photoLength);
Not sure where to add this......
4. Insert Image into Sql Ce
string connectionString = @"Data Source =\PhotoAlbum.sdf";
SqlCeConnection oConn = new SqlCeConnection(connectionString);
oConn.Open();
SqlCeCommand oCmd = oConn.CreateCommand();
oCmd.CommandText = "INSERT INTO Photos (name, photo) VALUES (?, ?)";
Added this, no problems (i.e. no errors) here.....
oCmd.Parameters.Add("name", label3.Text);
oCmd.Parameters.Add("photo", SqlDbType.Image).Value = photoBytes;
Added this, but since I don't have an image, I don't see anything. (??)
oCmd.Prepare() ;
int rows = oCmd.ExecuteNonQuery();
oConn.Close();
But it doesn't seem to work quite well. I am having problems in Step 3..... (particularly photoBytes)....
Any help would be greatly appreciated. If I'm too vague, I'm sorry. I'm a newbie at this C# thing and am just starting with SQL stuff. I've been mainly an HTML/Perl/CSS type of programmer. This is, by far, the toughest code I've worked on. Don't cut me down for my lack of knowledge!
Thanks,
M.
|
|
|
|
|
Hello, I am a beginner in writing pocketpc applications.
I am writing an application that has several levels of pages.
When the program starts, there would be a main page for user to choose his choices on a form. When clicked on certain link, can I show the new form/page at the same form? (Like webpages)
I can do it by placing different new pages in different user controls in normal Windows C# program. In this way, I can easily manage the different pages and "new" one when used. However, I found there is no such "user control" in C# compact one. Is it meant that I have to put everything (every new panel) on the same form?
-- modified at 4:54 Saturday 3rd December, 2005
|
|
|
|
|
I'm a newby to mobile development and was needing a hand figuring out how to load images into a pictureBox control at runtime, I had originally solved the problem using an imageList but decided the constraint of having a uniform size for each image in the list was not even close to ideal.
Thanks a bundle in advance for your help.
BMW
|
|
|
|
|
I have developed a Win CE 5.0 application using eMbedded Visual C++ 4.0 SP4. It runs fine on both Windows CE .NET 4.1 and Windows CE 5.0 emulators. I compiled the ARM version using ARMV4 configuration, but the resulting executable does not work on the StrongARM IPAQ 3870 neither on the xScale MDA compact / PXA272. Any suggestions?
Regards,
BB
http://spin.bartoszbien.com
|
|
|
|
|
I would like to activate the autorun feature for my CAB installers created with CabWiz (it has four cabinets, one for each platform). I know there should be several autorun.exe files located in \storage card\<cpu>\autorun.exe, where <cpu> is the winnt.h definition value of the target processor. The question is: what code should I compile into autorun.exe?
Regards,
BB
http://spin.bartoszbien.com
-- modified at 6:27 Wednesday 30th November, 2005
|
|
|
|
|
Hi everybody I am working on embedded systems and came to know about the timer importance in this area.
I get puzzled sometime by the software timers, why they are good compare to HArdware timer and interrupts as why they do save the Change in the CPU states.
Can anybody educate me on this more.
Regards
Anil Kumar
|
|
|
|
|
I am a new fresh man to the WinCE.
Could any kindly tell the relationship and difference between the two tools: PlatformBuilder and VS2005. What's they are each purpose?
When i install the VS2005,and then install the WINCE5.0, the remote tools in the VS2005 cannot work,does any one know why?
Any comment are appreciate! Thanks a lot!
|
|
|
|
|
i have to prepare a code on sending sms from mobile to pc and it should be recieved as email in Inbox in the pc and vice versa. Pls do forward any inputs on this ..
viv..
|
|
|
|
|
Well vivek thats a interesteing work u r going to do.
first of all i would like to know what comminication interface you are going to use for it.
Is it TCP/IP, UART ,bluetooth or what?
Anil Kumar
|
|
|
|
|
Hi,all,
Does anyone have some good ideas about derive form CCeSocket in EVC 4.0?
When I try to use the "Insert->new class",when I choose the "class Type" as MFC class, I just cann't find the CCeSocket from the "basic class". So I just write the codes myself. Do you have any decent way to do the same job?
pls tell me. Thank you
Best Wishes,
HWB
|
|
|
|
|
Please help me in mobile phone interface programming. How can I write and add another language bar in the phone settings? I mean to change the phone language to some other language with NOT Latin alphabet.
NastradamuS
|
|
|
|
|
Hi, all,
I am now using CCeSocket and met the OnReceive() bug: That is, on the server side, for the accepted socket, the OnReceive() never called. I have followed the steps on MS website but still cannot work. On MS website, it said the solving method applies to WinCE 3.0 and lower version. But I am now using WinCE4.2(PocketPC 2003). I don't know how to solve the problem now.
My procedures is as follows: modify the wcesock.h-> in my codes, after the listening socket accept the communication socket, make the latter's m_bConnectCalled = true->rebuild. Is there anything I miss?
Anyone got any good ideas? Thank you so much!
Best Wishes,
HWB
|
|
|
|
|
Hello, I am looking into having some GPS software written for me that would control the output of 1 or more applications when a certain height/speed parameter is met. Any takers??Contact me at tdolan@homelandsecurityaviation.com Thanks Tom
|
|
|
|
|
I have done some simple work
with GPS NAVMON module and VB .
I am basically a vc++ programer
but before i will under take i
like have a full details of ur
s/w requriement means a SRS.
Sir u can communicat to me with vikasamin@rediffmail.com
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I mean, are there any that have an option for making a mobile app?
Gonna get me some smartphone action
|
|
|
|
|
|
Hey there,,,,,,,,,,
im working on cygnal microcontroller C8051F040 and am trying to interface it with a sonar.t program is ready as far as the interfacing is concerned. but while sending the necessary data over the CAN bus to other nodes, i have a slight problem i.e. i can't store data on flash. Can u help me fined some sites where they have sample programs on CAN & FLASH. is there any kind of a clash between FLASH initialisation & CAN ?? I have configured the CAN bus at 1MBPS.
sonar runs at 115200 baud. and both the uart's run at 115200 baud.
without the FLASH, the data is transferred successfuly to all the other nodes. but with FLASH, the program hangs(if CAN is started.) I also tried disabling CAN before FLASH. doesn't work.. Can nybody help me??
Waitin eagerly....
reeva
-- modified at 2:17 Wednesday 23rd November, 2005
|
|
|
|
|
Hi All..
I need some advise about embedding database on a cd. I need to read and query on large amount of text-based info and binary data from this database. Please write any think that you could say about the subject on this subject like that if I am on the true place to ask about..
karanba
|
|
|
|
|
I would like to check the driver of an industrial pc in Embedded Windows XP.
The windows is very very simple.
After boot up, only a command is displayed.
How can I check its driver?
Please help!
|
|
|
|
|
Hi, I have a program written in eVC++ for a HP1710 PDA running PPC2003. I want my program to automatically run when either a soft or hard reset is done. If I place it in the start up folder it is ok with soft reset but gets wiped when a hard reset is done.
People in other forums have told me to create a folder in the flash memory(permanent memory) called "2577",place my program here and it should run once any reset is done. Also I was advised that if that did not work then create a folder called "0" and place it in that. Both these solutions do not work so I figured someone here might be able to help me.
Oh, the flash storage is called "iPaq File Store";
Thank you
Cush
|
|
|
|
|
When u do the hard reset, the DEVICE goes to factory settings. Meaning, it'll be set to the initial configuration which was provided by the vendor(i.e., program stored in the ROM are loaded.) So, you may want to load your program onto ROM than that of RAM. I'm not sure about writing into ROM.
Correct me If I'm wrong and let me know how to do the same.
Zxczc
|
|
|
|
|
Hi all
I am getting reasonably well with VB.Net using VS 2003 but i want to start doing some stuff for Windows Mobile devices (particulary WM5).
Where do i start? What do i need to develop Hello World! for WM5?
Any help appreciated
Chris
|
|
|
|
|
I'm having a problem with CryptAcquireContext in a .NET Compact Framework application running on the Pocket PC Emulator 2002. On a Pocket PC 2003 Second Edition (a real device) it seems to work fine.
The line of code I'm having a problem with is:
WinApi.CryptAcquireContext(ref hProv, null,
"Microsoft Enhanced Cryptographic Provider v1.0",
1,
0xf0000000);
WinApi is a class that contains the definition of all the PInvoked
methods.
[DllImport("coredll.dll")]
public static extern bool CryptAcquireContext(
ref IntPtr phProv, string pszContainer, string pszProvider,
uint dwProvType, uint dwFlags);
The problem is that on my machine, running the code produces an error 0x80000005
When I tried the code on a collegues machine, her Pocket PC 2002 Emulator produced a differernt error message. She got 0x80090019 on the same function call. I don't understand why there is a difference - both should be set up identically, but I guess there is something different that neither of us is aware of.
Finally, we tried to deploy it to a real Pocket PC device (PPC 2003 Second Edition) and it worked fine.
I need the code to work on PPC 2002 onwards. Does anyone have any idea why I am seeing different results? Or have any idea of how to fix this?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
0x80000005 - Invalid pointer.
0x80090019 - The keyset is not defined.
WinCE uses unicode, shouldn't you have L"Microsoft Enhanced Cryptographic Provider v1.0".
Or better yet, use the #defines in crypt i.e. MS_ENHANCED_PROV (MS_ENHANCED_PROV_W).
[EDIT]
Also, for the keyset error you should just create a new one:
bool rc = ::CryptAcquireContextW(&hnd, ct, MS_DEF_RSA_SCHANNEL_PROV_W, PROV_RSA_SCHANNEL, F);
if( !rc ) {
ulong err = GetLastError();
if( err == NTE_BAD_KEYSET ) {
rc = ::CryptAcquireContextW(&hnd, ct, MS_DEF_RSA_SCHANNEL_PROV_W, PROV_RSA_SCHANNEL, F|CRYPT_NEWKEYSET);
if( !rc ) err = GetLastError();
}
} [/EDIT]
[EDIT2]
Ok, Ignore the first EDIT, it's the same as shown in the MSDN docs (which i assume you've seen).
It's also for error 0x80090016 - Keyset does not exist.
From:
http://support.microsoft.com/default.aspx?scid=kb;en-us;238187[^]
NTE_KEYSET_NOT_DEF (0x80090019):
The Crypto Service Provider (CSP) may not be set up correctly. Use of Regsvr32.exe on CSP DLLs (Rsabase.dll or Rsaenh.dll) may fix the problem, depending on the provider being used.
So i would guess that the coding error is 0x80000005, and that her machine doen't get to that point because it's not setup right.
[/EDIT2]
...cmk
Save the whales - collect the whole set
-- modified at 9:35 Friday 25th November, 2005
|
|
|
|
|
This call(recvfrom) is waiting infinitely and the application never comes to next line.
I'm using UDP sockets. The data has been sent successfully to server. But I'm facing problem while receiving it. I tested on both smartphone emulator and real device(samsung). In both targets, the application is crashing when it reaches this line. Any idea why it's happening?. Your help is greatly appreciated.
i = recvfrom(s1,packetbuffer,sizeof(packetbuffer),0,(SOCKADDR *)&addr,&cbRemoteAddrSize);
Zxczc
|
|
|
|
|