|
This is one of the purposes that SQL CE is designed for so it should be a good choice (no installation, only single user etc...).
The need to optimize rises from a bad design
|
|
|
|
|
CodingYoshi wrote: Can I use SQL Compact Edition?
Quote Selected Text
Yes, that's the idea of it. It can be used for local, single user installs. As far as serialization is concerned, you'll have to have some type of mechanism that keeps the main database in synch with the local database.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
CodingYoshi wrote: Can I use SQL Compact Edition?
You can. If they need to merge changes into a master system, you could always use the Sync framework.
|
|
|
|
|
|
Hi All,
I have a little application maded with Visual Studio 2005 and SqlServer that shows the status of plans/activities. Kind of dashboard.
Now i have to show this dashboard on a PDA.
My questions is what do i have need/use for this?
Can anyone give me some info or references about this subject?
Thanx.
|
|
|
|
|
It can be done no problem with Visual Studio 2005 (I'm using 2008 now and have removed 2005 so I can't give you the exact steps, but I did several PDA apps with 2005). For the database, you can either connect remotely or use MS SQL CE locally.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi Dave,
Thanx for your response.
Could you give me the steps with VS 2008 ?
Thanx.
|
|
|
|
|
Create project | Smart Device | Smart Device Project
Name it and click OK
Select Target platform and .NET Compact Framework Version then Device Application.
There are differences between .NET [standard] and .NET Compact but *most* things will pretty much work by copying and pasting your code from your existing app.
You can connect to any database you like, but because of potential connection issues, any data that needs to be stored locally should be done in MS SQL CE and synchronized later (either over the internet/LAN or active sync). Just goto the normal Data menu and do/add what you need.
You can debug either in the built in Emulator or to your device if it's connected to the dev machine. This is the painful bit as it can take a while!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanx a lot. That was very helpfull
|
|
|
|
|
What is the best way to avoid connection, or thread pool limitations for my application? And am I doing it correctly?
I'm designing my own chat. It's necessary because my design is very different from any available out there. Because of the new security features in IE I can't use a different server than my website server for processing chat requests. I'm forced to combine my web app with my chat server.
So, my plan was to use ajax to make a page request. The page would then use asp.net 2.0's asynchronous pages feature to start a new thread and release the Thread that processes page requests. Then my plan was to have the thread wait until a new message comes in if I have no messages to send to the client immediately.
My two main uncertainties are this:
1) How do I best wait for new messages? Should I use a wait and notify? Should I use a WaitHandle(never used it before). Will I run out of threads in the thread pool from using these methods because they block? Is there a way to wait and release the threads at the same time?
2) Is there a limit on the number of connections that can be made to a web server. I want every client on my website to be able to receive notifications of new chat messages immediately, without polling. So, am I doing it right or should I use some sort of callback method that doesn't keep a connection open. is that possible???
|
|
|
|
|
I am trying to start an instance of an Outlook mail message with a few files attached, and am having some difficulty. I have about googled my fingers off to no avail...
The code I have currently will work for only 1 attachment:
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("OUTLOOK.exe");
psi.Arguments = "/a \"c:\\myfile.txt\"" ;
System.Diagnostics.Process.Start(psi);
I have tried specifying multiple /a command line switches to get multiple files attached such as /a "file 1" /a "file 2" , and I have tried arguments /a "file 1" "file 2" as well. I have had no luck with either approach.
Does anyone know of a way to specify multiple attachments through a command line argument?
Thanks for your help.
|
|
|
|
|
After doing more research, it seems that the only way to accomplish this is through the user of Interop libraries. This link[^] may be of use to others who are trying to solve the same problem that I was.
|
|
|
|
|
I need to serialize some class using XmlSerializer and write them to file. How can I do so if I want to use the same file and append more objects to it? For example, if I want to save Student records to xml file, first I will use the XmlSerializer to serialize the Student object. Then I can write it to a file called Students.Xml. If I want to write more students to the same file how can I append it to the existing file? The XmlSerializer adds extra elements which I do not need on every successive record. It adds tags like <student xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" datetimevalue="2008-09-24">
|
|
|
|
|
Did you try passing the same Stream or TextReader instance so it just appends students to it?
Stream s = File.OpenWrite("<filepath>");
foreach (Student student in studentList)
{
xmlSerializer.Serialize(s, student);
}
s.Flush();
s.Close();
</filepath>
I never tried it, just throwing an idea.
|
|
|
|
|
Le,
Thanks but no luck it still appends all the extra tags which I do no want to be repeated. This is because as soon as you call serialize the elements are created first then written.
|
|
|
|
|
The way I do this is to use a class that inherits from List<student>
public class StudentCollection : List<student>
{
}
public static List<student> DeSerialize()
{
}
and serialize the collection. If I add a student, I use my own add method and call Serialize afterwards.
public new void Add(Student student)
{
base.Add(student);
Serialize(this);
}
public static void Serialize(List<student> studentCollection)
{
}
It may not be the quickest or best way(?) but it works for me. I always prefer to deal with collections than trying to manipulate a lot of individual objects myself.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
modified on Wednesday, September 24, 2008 2:01 PM
|
|
|
|
|
That is exactly how I have it but here is the problem:
The user starts the application creates a few students--which I add to the collection--then presses save. Save takes the collection and serializes it and writes to the file. Here is the where I have difficulty: If the user shuts down the application and starts another instance and creates more records and presses save, how can I append the serialized collection to the file which already has some records in it. One solution is to deserialize all students from file into a collection, add new students to collection and reserialize them but that can become very slow if I have a lot of records in the file.
|
|
|
|
|
CodingYoshi wrote: deserialize all students from file into a collection, add new students to collection and reserialize
That's exactly what I do. It's not become a problem yet. I use binary serialization - I don't know if that's quicker or not. I can imagine on a very large collection it could be slow - or worse still with many instances possibly wanting to deserialize and serialize, actually being able to get access to the file could be an issue.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
You can append another serialized collection to the end of a file.
Just seek to the end of a file stream before serializing another
collection to the stream.
Of course, when you read it in you'll need to loop through all the collections.
Flat file databases get inefficient pretty quickly...
This is why relational databases were invented
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
When using an XML file that way, I suggest you use an XmlDocument instead.
When the program starts, you can read the file into the XmlDocument and then you can save it after each modification.
As far I can tell, XML serialization is best for passing things around, like to and from Web Services, not for persisting to a file.
|
|
|
|
|
how can i save the images,circles,rectangle,lines or etc together..
if somebody knows it then plz explain me with some code...
i konw that image can be save via one of the Bitmap's method
i.e:
imageObj.Save(fileName);
but i want to save not only images , whole it(e.g: circles,rectangles,lines which a user is drawn on it) not a just an image.
plz dont send the source of anyother site because i m new commer
hghghgh
|
|
|
|
|
If someone knows the answer, they would answer your first post. Posting again isn't going to make things any better.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
yes i made a mistake but what should i do, when nobody anser me..
hghghgh
|
|
|
|
|
The first thing to remember is that no one here is a professional answer person. We do it to help each other. If you are not getting an answer, we don't know or can't figure out what you are trying to do.
Try google for an answer to your situation. Many times a simple google search will get you an answer faster than posting on a forum.
Try re-stating what you are trying to do in plain simple english.
Include what you have tried to do that did not work.
Patience.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Sorry..........
i am making an image editor .....
this image editor can draw circle,rectangles and images....
the problem is that i am facing i want to save it..
hghghgh
|
|
|
|