|
No I can't. I'm sure I could come up with quite a few, but whether or not I'd get them all is a different matter.
|
|
|
|
|
Having to actually think about and plan your design upfront is certainly a disadvantage for some.
No comment
|
|
|
|
|
Can you spell Google?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi developers.
For caching data provided by a special server file I created an EntityModel which I store in a SQL CE database. Each time the user triggers an update of the database it should get resetted completely as it never had any data stored. That includes:
- Delete all entries of all tables
- Reset all indices
- Reset all identitys (auto increments)
But I don't have any idea how to wipe all the data and reset the tables. I want to keep the current database connection running and don't create an additional file.
Does any one have an idea how to reset the whole database to a fresh state?
Greetings
Daniel
|
|
|
|
|
To clear the tables you would use either of these
DELETE FROM [table name]
TUNCATE TABLE [table name]
To reset the identity columns
DBCC CHECKIDENT([table name], RESEED, 0)
Note I'm not certain these are available with SQL CE, but it should give you a start
No comment
|
|
|
|
|
I solved it using those statements, thanks. I was just wondering if there was any more common method for that:
private bool DeleteOldData()
{
using (var transaction = BeginTransaction(_database))
{
try
{
string[] tables = { "NToMMappingTable", "Table1", "Table2", "Table3", "Table4" };
bool[] alter = { false, true, true, true, true };
for (int i = 0; i < tables.Length; i++)
{
string table = tables[i];
_database.ExecuteStoreCommand(string.Format("DELETE FROM [{0}]", table));
if (alter[i])
_database.ExecuteStoreCommand(
string.Format("ALTER TABLE [{0}] ALTER COLUMN Id IDENTITY (1,1)", table));
}
transaction.Commit();
_database.AcceptAllChanges();
success = true;
}
catch (Exception e)
{
transaction.Rollback();
throw;
}
}
}
public static DbTransaction BeginTransaction(ObjectContext context)
{
if (context.Connection.State != ConnectionState.Open)
{
context.Connection.Open();
}
return context.Connection.BeginTransaction();
}
SQL CE does not support truncate or dbcc, but delete and alter table will work.
Thanks.
|
|
|
|
|
I was wondering which are the recommended ORM's for use with Microsoft Access? Specifically Access 97 and 2010!
We currently have a shed-load of Access 97 databases and an impending Office 2010 rollout, and as budget/time won't allow for conversion to SQL Server, we thought a first step would be replacing the front-ends with .NET WinForm apps. That way we could then migrate the backend to 2010 (or SQL) at a later date.
As far as I can tell EF and Linq2SQL don't work with Access (unless someone knows otherwise!). DataSets do (or at least should, can't get 2010 to work so far), but I was wondering if there was a more featured ORM that supported Access? Ideally with a visual designer.
My initial investigations have turned up Habanero, NHibernate and nHydrate.
|
|
|
|
|
A while ago I looked for a few different tools for Access including source control and couldn't find anything to hang my hat on. So I can't answer your question.
Thing is though, if you're going to rebuild the front end you may want to consider migrating to SQL Server then using EF. At that point the only extra work, other than rebuilding the front end, is recreating the business logic.
It may not be the case here, but most Access projects have the business logic mashed into the presentation anyway. So maybe the suggestion above may actually cut development time. Also I'd go WPF, Winforms looks so stale these days.
"You get that on the big jobs."
|
|
|
|
|
I have been using EntitySpaces (http://www.entityspaces.net[^]) for a while now using SQL Server, very good tool and support is excellent.
They also have a provider for MS Access.
Tosch
|
|
|
|
|
Hi
when am sending mails from my application,its sending and receving only one domain eg: info@ab.com.
if am trying to another emailid (eg:info@xyz.com),its not working ...how can i solve this
thanx
|
|
|
|
|
shijuse wrote: ,its not working
Please clarify what this means; show some of your code and explain exactly what happens.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
There is no step for checking the sender of an email in the email protocol. You can just forge the headers as you like, and send an email as president@whitehouse.gov. But many email providers try to fight spam and add some checking mechanisms. I guess that that happened with your emails.
|
|
|
|
|
How are you sending the emails? through your mail server? or by using system.net.mail .
Without know how you are sending the emails its impossible to let you know why its not doing what you would like it to do.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hi friends. Is it possible to converting dll file to cs files.
Is there any mechanisms related to this?
|
|
|
|
|
|
just google "Reflector" or "Decompiler .net"
there r tools from telerik named just compiler ---free
but best of the best is from redgate's Reflector---trial commerical
|
|
|
|
|
|
I have used ILSpy recently for this. Free and can save source as a project.
|
|
|
|
|
If you don't own the DLL in the first place, make sure it's not against the licence agreement to decompile it – it usually is. And, obviously, the solutions provided only work if it's a .Net assembly, but .exe and .dll are also used for native code libraries.
|
|
|
|
|
Hi
I have .Net 2003 version of windows forms applications.
Since these applications(exe files) are being accessed by all the users from server(using shortcuts) we used to see few performance issues. So I have been asked to develop my own tool/utility to do the load testing/performance testing.
I need your help to develop the tool, like tips/any ideas on how to develop the tools and etc. If we have already any free tools can be downloaded and can help me will be great.
|
|
|
|
|
There are a lot of existing tools for performance testing. Download a trial version and see which product help you the most to find your performance problems and then buy that tool.
You can always uses StopWatch or some other performances counters or timer for simple cases but for any serious profiling I would recommand buying a tool.
In some case, it seems that some tools allows you to uses the results of the trial version to improve your application. You have to read the license carefully.
I would hope that Visual Studio Ultimate would not be as much expensive as there performance tools work well.
Philippe Mori
|
|
|
|
|
Im looking for a special linq query, that splits a given Enumeration of int (or whatever) as follows:
Source: {1}{1}{0}{0}{1}{1}{1}{0}{1}{1}{0}
Target: {{1}{1}} {{0}{0}} {{1}{1}{1}} {{0}} {{1}{1}} {{0}}
There are many examples in the net how to do it with a static number of elements e.g. 2:
Result {{1}{1}} {{0}{0}} {{1}{1}} {{1}{0}} {{1}{1}} {{0}}
This approach is done by an extension methode, so I implemented mine on that base like this:
public static IEnumerable<IEnumerable<T>> Split<T>(this IEnumerable<T> source)
{
var remainingSequence = source;
var lastElement = remainingSequence.Take(1).First();
while (remainingSequence.Count() > 0)
{
Console.WriteLine("Remaining {0}", remainingSequence.Count());
Console.WriteLine("last Element is {0}", lastElement);
yield return remainingSequence.TakeWhile(t => t.Equals(lastElement));
remainingSequence = remainingSequence.SkipWhile(t => t.Equals(lastElement));
Console.WriteLine("New Remaining {0}", remainingSequence.Count());
lastElement = remainingSequence.Take(1).FirstOrDefault();
Console.WriteLine("After assign {0}", remainingSequence.Count());
}
}
When I call this from a main() with
foreach (var X in valuelist.Split())
{
Console.WriteLine("--> " + X.Count());
Console.ReadKey();
}
I get the following output (endless):
Linq extension:
1st iteration
Remaining 14
last Element is 1
--> 2 until here, everything looks fine
New Remaining 12
After assign 14 here is the strange thing, it switches back to my initial remainingSequence when assigning the new 'lastElement'
2nd iteration
Remaining 14
last Element is 0
--> 0
New Remaining 14
After assign 12
endless circle due to resetting the
Remaining 12
last Element is 1
--> 0
New Remaining 12
After assign 14
Remaining 14
last Element is 1
--> 0
I do not get it, why the program behaves in that way.
Anyone who can guide me the right direction?
Thanks in advance!
|
|
|
|
|
Message Removed
modified 27-Oct-11 16:57pm.
|
|
|
|
|
Ups, sorry, my fault
|
|
|
|
|
However, the damages is done. You started here and should continue here, reposting is frowned upon. You can't delete a post once you have received replies.
No comment
|
|
|
|