lolafuertes 145 Master Poster

I my opinion, the problem arises when you try to use a byte array to fill a parameter without specifying the parameter type
because the default costructor may decide thet the longblob is equivalent to longtext and then translate to string.

please see this discussion about when to use the new AddWithValue or the old Add to explicily specify the SQL type of parameter.

lolafuertes 145 Master Poster

First, the if (reader.HasRows) will always return true, because even no record exist for OracleCommand("SELECT COUNT(*) FROM CONTRACT_INFO WHERE (rid = @rid)", con); the Count(*) will return 0;
At this point, if the returned value is 0, then is OK to insert, if the returned value is >0 will be OK to update.
I would suggest, that you write something like (not tested):

int returnedNumber = 0;
if (reader.HasRows)
{
    returnedNumber = reader.GetInt32(0);
}
reader.close();
if (returnedNumber == 0)
{
    // do the insert
}
else
{
    // do the update
}

This way, in first place, you store the response and close the reader, freeing the connection.
On second place, you will not need an additional connection to the database server, so will need less resources in the application and in the server.

Hope this helps.

lolafuertes 145 Master Poster

Maybe this article can help to understand the differences between process (or application) virtual machine, system virtual machine and host virtual machine.

Probably in your local machine the cobol process runs in the same process/host virtual machine than the form while in your system virtual machine is running in distinct process/host virtual machines just because the virtualization. This can be the reason to fail to set the parnet handle.

There are various cobol languange builders/versions but most of them are using a proces virtual machine to interact whith the OS.

Hope this helps.

lolafuertes 145 Master Poster

You can start reading this

lolafuertes 145 Master Poster

A quick seach result in this link

lolafuertes 145 Master Poster

This behaviour is due to the fact that the form methods are executed inside the same thread, so no invoke is required.

The invoke will be required if the form is executed ina distinct thread than the method caller.

IE. Windows form application. The FormMain has a timer to show the date an time every second. The form is launched inside a main static class using FormMain.Show(). The static class continues to execute and uses an Application.Doevents() to allow the FormMain to show. At this moment, the static class is running in the thread 1, and the form in the thread 2.
In this situation, the invoke will be required.

Hope this helps.

lolafuertes 145 Master Poster

You should add a reference in your project to the assemby from framework entitled as System.ComponentModel.DataAnnotations.

Usually this is done automatically by the nuget package manager if you select to add the EntityFramework from nuget.org to your project

Hope this helps

lolafuertes 145 Master Poster

Please read this link for how to move a file.

To do that, you need to have the rights to acces the server. Please read this.

Hope this helkps

lolafuertes 145 Master Poster

I am not sure what the check is doing, but, IMO, you need to define the program a a single insatance running, and check at the beginning if another instance is running then shutdown the current one.

I would suggest this article for that purpose.

Hope this helps

lolafuertes 145 Master Poster

To launch the c/java from c#, assuming is an exe file, or the file extension has a 'open with' configured on your system, you can use some thing like

var fileToLaunch = "SomeFilePathHere";
var process = new Process();
process.StartInfo = new ProcessStartInfo()
{
    UseShellExecute = true,
    FileName = fileToOpen
};

process.Start();
process.WaitForExit();

then to open the resulting file, you can use a stream reader like:

StreamReader streamReader = new StreamReader(resultingFilePath);
string text = streamReader.ReadToEnd();
streamReader.Close();

You shall need project references for the System.Diagnostics and The System.IO namespaces

Hope this helps

lolafuertes 145 Master Poster

Maybe this example can enlight you

lolafuertes 145 Master Poster

If you already solved it, please post here the solution for others to learn., and mark as solved.

Tx in advance.

lolafuertes 145 Master Poster

Anyway, have in mind the info of this article to monitor the system performance even is related to W2003, is still valid for all the versions of server and also client after NT 4.

Hope this helps

lolafuertes 145 Master Poster

Just a few hints.

In order to update a database you do not need to issue a select clause first.

So, I will remove all the code related to the commandSelect string in the UpdateQuantity procedure.

Also note that the UPDATE command, will update all the records that match the condition IN (...). In this case, you are updating always both code 1 and code 1 to the same value.

I would suggest to replace the procedure to something like:

private void UpdateQuantity()
{
    // this index will be used to loop over the container
    int index;
    // Here we will store the code once verified to be integer
    int codeValue = 0;
    // Create a new connection to the DataBase
    using (OleDbConnection conn = new OleDbConnection(connectionString))
        {
            // Open the connection, usually will not fail
            conn.Open();
            // For each row entered ...
            for (index = 0, index < textBoxCodeContainer.Length, index++)
            {
                var tb = textBoxCodeContainer[index]
                // and if the code is integer...
                if (int.TryParse(tb.Text, out codeValue))
                {              
                    // Issue an update command to the DataBase
                    // Note here that the subtract operation is in the SET clause
                    // updating the old value with the result of substract the paramenter quantity
                    // from the old quantity value
                    string commandUpdate = "UPDATE [Seranne] SET [Quantity] = [Quantity] - @Quantity WHERE [Code] = @Code )";
                    using (OleDbCommand cmdUpdate = new OleDbCommand(commandUpdate, conn))
                    {
                        //Add the parameters for the code ..
                        cmdUpdate.Parameters.Add("Code", System.Data.OleDb.OleDbType.Integer);
                        cmdUpdate.Parameters["Code"].Value = codeValue;
                        // and the parameter for the …
lolafuertes 145 Master Poster

Just my cent.

Additional to the excelent info from ddanbe, here after a couple of links:
Windows forms coordinates on MSDN (here)
Coordinates systems on Wikipedia (here)

Only to say that the values to define a drawing point in a screen are always in positive values referred to the top-most/left-most corner of the screen. As X axis increases, the point is moved to the right and as Y increases, the point is moved down.

Hope this helps

lolafuertes 145 Master Poster

In order to use a mix of icons and other kind of columns, the listview view proerti should be set to List or Details. The List shows an icon with a label. The Details can show the icon (and label) in the left-most column. For further info click here
Hope this helps

lolafuertes 145 Master Poster

What kind of software are you using to create the bootstrapper?

lolafuertes 145 Master Poster

What is the original content of dt3?

lolafuertes 145 Master Poster

As a general rule, when you think about tasks, you must think about isolated processes, having thier local data, connections, and results, all of them running asinchronously from the main thread, and avoiding possible collisions.

Can you isolate the offending row inside the task?

Hope this helps

lolafuertes 145 Master Poster

All the addresses starting with 10 are free. In fact, this range of addresses is used internally by big (or not so big) corporations to allow internal private networks, and go to the internet through a router having a poblic internet address.

Some ISP use the 10.x.x.x to get fake 'fixed' ip addresses, which probably is your case.

To allow more addresses in a unique subnet, is enough to change the mask. The mask determines how many elements can be hold in a subnet.

In binary format, the mask has ones in the left side and zeros in the right.
If you apply this mask to any ip address, you'll have the LAN identification.

In fact, the 10.xx.204.0 with a mask of 255.255.255.0 can handle 254 addresses, the self address and the multicast (total 256)
if you apply a mask of 255.255.254.0 instead, you are changing the identifier of the lLAN and, if your equipement can handle this in the right way, will distinguish perfectly both nets having distint mask. Whith this a such mask, you'll handle 510 addresses plus self and multicast.

To change the mask in you network, is not so easy because you need to know how is configured you LAN and WAN equipement, and if they can handle it, to change the way they work with the mask(s).

Probably, the best way will be to contact with your provider for support.

Hope this helps

lolafuertes 145 Master Poster

According to http://tools.ietf.org/html/rfc5321 and http://tools.ietf.org/html/rfc5322 you can distinguish between the from field in the message and the return-path field.

You can 'mask' the sender, but the delivery status can be sent back by means of the return path.

Anyway, a deep analysis of the message content allways will show the server address originating the message. So...be carefull.

Because in most cases masking the originator is a sign of SPAM, be aware that most ISP have a policy to block the senders that can not be verified.

Also, most of them also will block the sender if the number of to addresses is higher than a certain amount by unit of time (IE minute, hour)

Hope this helps

lolafuertes 145 Master Poster

Just a free solution. Inside a Windows Active Directory Domain, you can set a Group Policy to stablish the user level rules for remote control, being able to see what is doing the users, even without user permission.

Anyway, the practice to 'supervise' what the user is doing, without his/her knowledge, in most countires is considered delictive (to spy) when the user is not advertised first that this can happen, and also signs a document allowing it.

Be careful.

lolafuertes 145 Master Poster

As you are not showing us the template, nor the code to fill it, I can only give you a few hints:

The blank page, exist on your template? If yes, then remove it from the template.
Is generated due to some fields being filled with blanks? If yes, don't fill those fields with blanks.
Is generated because you always insert a new page mark? I yes, insert the page mark only if really is needed.

Hope this helps

lolafuertes 145 Master Poster

Usually when you buy a PC, a bootable recovery disk exist, or can be created after the automatic installation process.

If you have not it, you can ask to the manufacturer for a recovery disk and boot from it, then use the recovery option.

In many cases, this happens if the registry files, or paging one, is(are) heavely damaged, possibly due to a phisical error on startup disk.

A low cost verification is to move your startup disk to any other PC having compatible disk connectios, and verify it using the chkdsk command with the /R parameter to recover bad sectors give a clue on the possible failure of the disk. Also you can check it for any virus there.

Hope this helps.

lolafuertes 145 Master Poster

You already know that the unistall option is not officially supported by MS.

Did you really want to uninstall W8 or just always start W7 instead? This second option is simple: In the Control panel of W8 -> System -> Start -> change the default boot option to W7.

To uninstall W8 and leave W7 as the unique OS in the machine, this is a very good link but is not guaranteed that always will work.

Hope this helps

lolafuertes 145 Master Poster

Please, post your code for creating the text boxes array in VB and we will try to help you with some thing equivalent in C#

lolafuertes 145 Master Poster

Wy the line 34 sentence? this will clear all the preceding content in the command and create an empty one, so executing an empty command will fail.

Also, you are using the Parameters of the sqlcommand, but you do not defined any in the sql sentence.
Please visit this page http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx for examples on how to define and use the Parameters.

Hope this helps

lolafuertes 145 Master Poster

And if you are using a windows OS, then the console command FC will do it, and also you ca redirect the output to a file using the standar output redirector.

lolafuertes 145 Master Poster

See this thread

lolafuertes 145 Master Poster

I'll try to enlight you a little bit.

First, we can not say you why the application is writing the double back slash before the point if you do not put here the code that produces those results.

Second, a drive letter probably can not be fixed unless you can fully administer on all the machines:
a) Hoy many phisical drives exist on the machine and the drive letters assigned to them
b) If the user can connect to a share using the net use on windows machines.
c) If the user can use the subst command on windows machines, to acces to a folder as if it was a drive
d) How USB (or firewire, or Sata) external drives will be mounted
e) The total number of mounted drives

Also have in mind that, on windows machines depending on the installed OS version, the free drives letter assignement goes from d to z while on others goes from z to d

Hope this helps you

lolafuertes 145 Master Poster

There is no simple path to convert an aspx web project to a windows form one.

As an starting point, I will propose the following steps:

  • Create a new CS windows form project. Let the form name as Form1.
  • Design de form to have the 'same' appareince than the web page.
  • Then open the Form1.cs for edit code.
  • You can Copy-Paste from the old code in Uploadfile.aspx.cs (lines 24 to end) to the new file, removing any reference to System.Web and honoring the default code created by the designer on the new project.
  • Adjust the clic events in the forms designer to point to the 'pasted' ones.

Hope this helps.

lolafuertes 145 Master Poster

Just because of

int i = 0;

on line 22. This sets the i value to zero on each loop iteration.

To work as you expected this sentence should be on line 19 instead.

Hope this helps

lolafuertes 145 Master Poster

If I unsertood well your issue, the sentence Request.QueryString["Id"] is returninng a null or empty string or a zero value.
Please, verify what is the real content of the requested string.

Hope this helps

lolafuertes 145 Master Poster

And yes, as said by @priteas, you will need the permissions to alter the database to use the sentence

SET IDENTITY_INSERT ....
lolafuertes 145 Master Poster

The SQL SET IDENTITY_INSERT must refer to a table, but in your code it refers to a column in the table. (see here)

In your example, the sentence would be:

SET IDENTITY_INSERT LOCATIONS_SETUP ON

Just to comment that, in general, is not a good idea to insert specific values in an identity column.
If you want to do that, first you need to verify that the value to insert in the table does not already exists.

Assuming that the identity colum in your example is LoacationId, you should rewrite your sentence like:

IF NOT EXISTS (SELECT LocationId FROM LOCATIONS_SETUP WHERE LocationId=10) INSERT INTO LOCATIONS_SETUP(LocationID, LocationNumber, LocationName, LocationAddress1, LocationAddress2, LocationAddress3, LocationCity, LocationState, LocationZipCode, LocationZipCodeExt, PhoneNumber, FaxNumber, BillToAnswer, BillToLocation)
VALUES(10, 1, 'Traditions in Tile / Buford RDC', '4325 Hamilton Mill Rd', '', '', 'Buford', 'GA', '30518', '', '(770) 831-5324', '(770) 831-6774', 'N', 36)
ELSE ....

On the else clause you must take an action when the value to be inserted already exists, like raising a SQL error.
Once you have inserted the value you must revert the permission to insert identity values using

SET IDENTITY_INSERT LOCATIONS_SETUP OFF

Hope this helps

lolafuertes 145 Master Poster

Say I have a class that I want to use in multiple projects, what namespace do I give it?

I would just create a separate project for this class, anc createa separate assembly (.dll)

Then, on each project i'll need it, just adding a reference to the .dll is enoug to fully use it via using statement.

IE, if you create a clas called TheClassToShare inside a project called Wdrago, your default namespace for this class will be Wdrago.

On the project referencing your .dll, you can use your class writing something like

var a = new Wdrago.TheClassToShare();

Hope this helps

lolafuertes 145 Master Poster

See here (with example)

Hope this helps

lolafuertes 145 Master Poster

The hypen is usually understood as a minus sign, so the parser tries to calculate INV minus PART minus NUMBER !!!

The solution is to surround the field names between [ ] Ex:

"SELECT [INV-PART-NUMBER], [INV-DESCRIPTION] FROM INVENTORY where [INV-PART-NUMBER] like " & search1

Hope this helps

lolafuertes 145 Master Poster

The first, post your code here and explain what is expected todo, what is not working (and where) and any message that can help us to help you

lolafuertes 145 Master Poster

Usually this happens when:

  • Some dll is missing to load the application
  • The target machine is a 32bit but your application is 64
  • The user has no rights to exetute the application
  • The user has no rights to open a required file in the system

etc.

Probably, you can get a clue if you try to find some info in the machine system or application log.

Hope this helps

lolafuertes 145 Master Poster

check if a certian ADO Connection has been setup on a clients Local machine

See this article

If the registry keys does not exists nor at machine level nor at user level, there is no DSN defined in the computer.

You'll need admin rights to verify those registry entries for users others tan tours.

Hope this helps.

lolafuertes 145 Master Poster

In wich line of your code you obtained the:

update database (object reference not set to an instance of an object)

??

lolafuertes 145 Master Poster

Just a hint: The "RunOnTime" procedure must be declared public and must be available in a module to be triggered, now and also at the expected time, so the best place to store it is at the personal macro workbook.

To create a such workbook, please read here

Hope this helps

lolafuertes 145 Master Poster

I guess you will need to construct a MySql Command like:

SELECT title FROM table WHERE name = 'actor1' OR name = 'actor2' OR name = 'actor3';

To create this sentence dinamically, you'll need verify if exist any item in the listbox2 and, if they exist, cicle over the items in the listbox2 creating the where part like (untested):

If listbox2.Items.Count >0 then
  Dim strSQL as string = "SELECT title FROM table WHERE "
  Dim strWhere as string = ""
  For I as Integer = 0 to listbox2.Items.Count-1
    If strWhere.Length > 0 then
       strWhere &= " OR "
    End If
    Dim itemName as string = CStr(listbox.Items(I))
    strWhere &= " name = '" & itemName & "' "
  Next
  strSQL &= strWhere & ";"
  '
  '  here you must add the necessary code to:
  '    create a command using the strSQL as command string, and the existing connection to the DB 
  '    create a DataAdapter from the command
  '    and fill a movies DataTable with it
  '  then, use it as the datasource for the listbox3 and refresh it.
  '
End If

Hope this helps

lolafuertes 145 Master Poster

Probably you have seen that there are some applications that are able to 'undo' the last action. There is no magic behind.

The programmer of those applications had to define how and what an undo button does, like any other button.

Now, on your application, you just need to write the code to be executed when the undo button is pressed.

The info by @tinstaafl is an example of a handler to determine which button has been pressed, but you need to add the necessary code to undo the action.

Using your example,

"UPDATE fieldname='" & variablename & "' FROM database.tabename WHERE date='" & storeddate & "';"

in order to undo this action, you need to do one (or many) UPDATE sentence to restore the values before you did the UPDATE.

How you can handle that?

Before doing your "UPDATE fieldname='" & variablename & "' FROM database.tabename WHERE date='" & storeddate & "';" you will need to create a command like

"SELECT TOP 100 PERCENT * FROMdatabase.tabenameWHEREdate='" & storeddate & "';"
Whith this command, yu'll need to create a data adapter to retrieve the info from the DB and fill a new Dataset (using the data adapter) with a table having the result of this select. Remember that your table must contain a field that identifies each row.

This way you'll have the values before doing the update. But this is not enough.

Also you need to save this info in a file using the Dataset save …

lolafuertes 145 Master Poster

Just adding a little bit of food...

i have multiple buttons and text boxes that recieve's its corresponding button

Maybe you'll need a table (lets name persistInfo) having 2 string fields: variableName and value.
Then an structure (lets call it undoStatus) is needed to

  • Identify the order of each click
  • Identify the event cached
  • Identify the old status persisted temp file having the variables modified by the click, and their values before the click has been done.

With this structure, you 'should' declare an static List<undoStatus> and fill it with a new undoStatus each time you handle a click event (or whatelse event you want to catch for undo).

When you'll catch an event, you'll need to:

  • Create a new persistInfo table in a new Dataset
  • Fill it with the relevant variable names and their old values
  • Save the dataset with a unique name (IE using the DateTime.Now with a mask of yyyyMMddhhmmssffffff)
  • Get the new order for the structure: can be obtained using the Linq Max function againt the list and adding one to the obtained value, or setting a 0 value if nothing is in the list. Remember this value in a static variable.
  • Set the event info and the file name for the dataset saved.
  • Add this to the list.

To undo:

  • Get the item in the list having the highest value remembered.
  • Read the referenced file into a new dataset.
  • For each row in the table, assign the old values to …
lolafuertes 145 Master Poster

Sorry for reply a little late. This is also a generic answer...

If you have many 'click evente' to catch, in my opinión, the best solution is to create an ordered list of events catched, including info about the order of caching, the 'title' of what you cached, and the location of the persisted info.

The undo action, will allways be done from newest to older. So, you need to get the highest order value in the list and retrieve this info, get the persisted info, and act according, and remove this entry from the list.

Hope this helps.

lolafuertes 145 Master Poster

Is not a bandwidth (speed) problem, is a traffic (volume) one.

Imagine an scenario: 1 web server, 100.000.000 pages accessed each day. If you put some proxies in the middle, all the static parts will flow only from the server once, then from the proxies, while the dynamic part flow always from the server.

This helps to diminish not only the traffic but the server work.

Hope this helps.

lolafuertes 145 Master Poster

No problems to access for me.

Did you checked the estándar things like cable, router, firewall, ISP provider, line, socket, netting card, etc?

lolafuertes 145 Master Poster

Maybe here http://www.omnetpp.org yu'll find what you are searching.