lolafuertes 145 Master Poster

IMO is better to just make a connection to the server for each file and act according to the response.
Each connection can be done inside a background worker, in order to alleviate the GUI to be frozen while the transfer occurs.
Hope this helps.

lolafuertes 145 Master Poster

Maybe, tou need to define fmrplantnum sfpn; at form level, then on the txtnumero_KeyDown use

 sfpn = new fmrplantnum();
 sfpn.Show();

This will not destroy the frmplantum immediately after showing.

Hope this helps

lolafuertes 145 Master Poster

If you are in a windows domain and have an Active Directory published SQL Server, then you can retrieve it from the AD. If you have more than one, some one should decide wich one should be used. If yopu need help on how to query AD, please open a separate thread.

If no SQL server is published, and if you are sure that this process will execute on the server himself, then you can always use the 'localhost' name if the TCP server & client protocol is active in the SQL Server Configuration Manager both in the server and in the client configurations.

Then you can use the offline utility SQLCMD.EXE to execute any SQL script.

Hope this helps

lolafuertes 145 Master Poster

According to the attached files, you need:

  • To open the SQL Server Management Studio and connect to your SQLEXPRESS instance.
  • Verify if a database called Project exists. If not, then open the Project.sql file in the root and execute it to create a database called Project.
  • Verify that there is no error and close the SQL Server Management studio.
  • With you VS 2010 Open the sln file in the folder Data Base Project C#. If your PC has a name other than ZACH-PC, you'll need to replace this name in every connString in the project.

Then the database and your project are connected.

Hope this helps

lolafuertes 145 Master Poster

Instead of inserting the tags value directly into the list view, you should create a list view Item with the value of tags.

Using the tags field, you need to ceate a select command to the daabase to find if the record exists.

In order the command to the database can be executed, you need to hava a connection to the dabase, that must be in open state before executing the command.

To retrieve the info from the database, you can use a data reader, from the execute reader function of the command.

Using a try catch structure, you must verify id the data reader has rows, to be certain that you find the tags value in the database.

If has rows, then you must force a read to retrieve the first row, that should contain the related info, and add subitems to the list view item with the value of the corresponding returned field.

If has no rows, then you must add the right number of subitems to the list view item with an empty string.

Catch any errors and finally you must close the data reader.

Then you can add the list view item to the list view.

Hope this helps

lolafuertes 145 Master Poster

Did you already worked on it? Post your code here and make a comment on what is your doubt or not working as expected.

lolafuertes 145 Master Poster

No way to spread your program to remote computers to be compiled and run by them.

This is a basis for not spread viruses.

lolafuertes 145 Master Poster

@legendster: or uploading. Mostly because the brouser can't return the ack to the sender.

legendster commented: Agreed +0
lolafuertes 145 Master Poster

If I undertood well, you are trying to install a cluster node in a W7-64
You need to install a non cluster, default instance, in a W7 machine. Because the Enterprise license is really expensive, and intended for server environments, maybe you just want to install a developer or standard license in the W7 machine. See here for the different versions features and verify wich of them do you really need.

Hope this helps

lolafuertes 145 Master Poster

Here you can find how to start the resource monitor. If you expand the Network tab, you'll find all the processes that uses networking.
Usually you'll find one or more instances of svchost.exe. This is because this is a 'dummy' process to hold the dinamyc libraries (dll) offered by the OS, so they are loaded and ready to be used. This include client for DNS (required), TCP listener, etc.
Also you'll get a list of other processes like googleupdater or live mesh or whatelse that are running on your computer.

Hope this helps

lolafuertes 145 Master Poster

What you tried so far?

lolafuertes 145 Master Poster

Maybe an old style can be used here, some thing like

CmdinsertSite = New SqlCommand(String.Format( "insert into SiteStock(serialno,partno,technicianID,dispatcherID,ATMID,DateDispatched) values ({0},{1}, {2},{3},{4},'{5:yyyy-MM-dd}')", serialno, partno, cbSARtech.SelectedValue, cbSARdispatcher.SelectedValue, cbSARatm.SelectedValue, Ctype(dtpSARdispatchdate.Text,Date) ), AddConn)

If any of the values is not numeric, you must surround the {} with '. IE: if the third parameter was string then '{2}'.
I would suggest that Dates are to be presented to SQL always in universal format, so no mistake between 6/7/2012 being June 7th or or July 6th 2012.
Also if a parameter is string, you should use the string replace function to replace each single ' with two consecituve ones in the string to avoid the code injection.

Hoipe this helps

lolafuertes 145 Master Poster

In order to understand what are you doing, and be able to try to help you, please, be so kind to post your coding so far and comment it indicating where you find the problems, the expected resutls and the actual ones.

Thanks in advance

lolafuertes 145 Master Poster

This is a kind of control, outlook like side bar menu.
Here you can find a CodeProject source for a first step. Or there.

Hope this helps

lolafuertes 145 Master Poster

The most common solution is to create a server process to be run on each computer in the lan, that will capture the screen image at video card level.
Trying to send an image through the lan is expensive, so most solutions use some kind of compression algorithm to reduce the picture size, and/or uses to send only the changing parts.
Then, a viewer will 'get in touch' with each server to receive the new picture / or updated parts, to be shown in the viewer, and compose the resulting image.

You will need to stablish some kind of protocol to exchange the info between the server an the client. The RDP (Remote Display Protocol from Microsoft) can be used for this purpose.

Also VNC has an open source solution, you can use to start.

Hope this helps

lolafuertes 145 Master Poster

Usually the joystick manufacturer will provide you with some API that will interact with the joystick driver to capture the joystick movements.

Hope this helps

lolafuertes 145 Master Poster

A data adapter should have four commands:
1) Select -> to retrieve the data and used in the fill of a datatable
2) Insert -> to put the new rows into the database
3) Update -> to update the row content in the database, and
4) Delete -> to remove the deleted rows from the database.

As far as I can see in your code, only the SELECT and the UPDATE commands are defined for the data adapter.

Hope this helps

lolafuertes 145 Master Poster

Using a data binding source between the table and the datagridview, the Current property of the binding source point the the current data row.

Hope this helps

lolafuertes 145 Master Poster

Sorry, bad typo.

Should be
If codeExists = 0 then

lolafuertes 145 Master Poster

This is another approach using two trips to the server to verify if the code exists and insert if does not:

With lvitem
    '
    '  first, search in the db if the code already exist using the function count(*) that will return 0 if the code not exists or 1 it it does
    cmd.commandtext = "selct count(*) from cust_reportcode where reportcode = '" & lvitem.subitems(0).text & "'"
    '
    '  to retrieve the information, you may use a datareader, that will return a row with the returned info
    dim dr as MySql.DataReader = cmd.ExecuteReader
    dr.Read()
    '
    ' now, the reader will return the right value
    dim codeExists as integer = dr.GetInt32(0)
    '
    ' you have the info, close the reader before doing any thing more
    dr.Close()
    '
    ' Now you can decide
    If codeExists > 0 Then
        cmd.CommandText = "insert into cust_reportcode(reportcode,first_name,last_name,total_item,total_price,date_trasaction) values " _18.& "('" & lvitem.subitems(0).text & "','" & lvitem.subitems(1).text & "','" & lvitem.subitems(2).Text & "','" & lvitem.subitems(3).Text & "','" & lvitem.subitems(4).Text & "','" & lvitem.subitems(5).Text & "')"
        cmd.ExecuteNonQuery()
    End If
End With

Hope this helps

lolafuertes 145 Master Poster

Glad to know. Is always a good practice to share you final solution with others.
And please be so kind to mark the thread as solved.
Thanks in advance.

lolafuertes 145 Master Poster

I would suggedst that on the click event of the button to login, you need:

  • Create a SQLConnection to the SQL Server pointing to the right database, and open it.
  • Create a SQLCommand that will return a record if the user and password exists in the relevant table of the SQL database usiing a CommandText like

    SELECT * FROM yourtable WHERE UserName = '" & textBoxUserName.Text & "' AND Passwrod = '" & textBoxPasswrod.Text & "';"

    and using the opened connection on the step before (Obviously you'll need to replace the table name of yourtable with a valid one, and also the field names and the textbox names).

  • Then create an SQLDataReader using the command created on the previous step and try to Read it.
  • If the Read fails, then the entered values are not a valid user/password pair.
  • Do not forget to close the reader and the connection.

Som hints.

  • When defining the password textbox, set the password character in the textbox properties.
  • Is usual to encrypt the password and store it encrypted. In this case, you will need to use the same encryption method used to create the passwrod.
  • Is a bad design to store the passwords in clear text.

Hope this helps

lolafuertes 145 Master Poster

The DCOM ( Distributed Component Object Model ) uses a server (provider) object and a client (consumer) one.
So you can use Excel as a DCOM server and a C# application as client, both running in the same computer.

I know that the article is quiet outdated but the principes are right.

Your software is using som external DCOM provider like AdobeReader or Adobe Writer, or any Office program (Word, Excel, PowerPoint, etc) or IE, or any third party element that, on the target computer, is missing or has an incompatible, possible outdated, version.

Please, review the dependencies on your project dependencies and in the setup, to verify the required dll and/or exe and the right versions.

Hope this helps

lolafuertes 145 Master Poster

You need to stablish a connection to the access database. Then you must create a command to select the relevant recortds from the table you want.

You will need a datatable where, using a table adapter (from the commend created), you'll fill with the data.

Then you can use the datatable as data source for the listview.

Hope this helps

lolafuertes 145 Master Poster

You can use a from linq command to select the entity and apply a where clause for the PK to verify if it exists on the entitycollection, so you can decide if the returned collection has 0 elements then you can add the new element to the entity. Otherwise, the PK already exist, and you can decide to update the relevant entity element or just ignore it.

Hope this helps

lolafuertes 145 Master Poster

Please post your code to understand what are you doing and try to help you.

lolafuertes 145 Master Poster

It would be interesting if you kindly post the full error message to understand what the error is.

lolafuertes 145 Master Poster

Please, be so kind to share your howto here, and then mark the thread as solved.
Thanks in advance.

lolafuertes 145 Master Poster

So basically, you read a console command and need to parse it?
The command read, should be in some string and you can use the split function to obtain an array of strings between the designed separators.

IE:
copy ttt.txt>yyy.ddd

You read this into the inputCommandString.

Tehn you can obtain the order and the parameters usint the split function:

dim orderAndParameters as string() = inputCommandString.Split(" "c)

Then you can verify the order and parameters by using a select - case structure:

select orderAnParameters.Length
case 0 ' no order nor parameters
 ' send a message? or ignore it?
case 1 ' only an order
 ' verify if the order is one of the possible orders without parameters or show the order usage in case of wrong number of parameters
 case 2 ' the order and one parameter
  .
  .
  .
 case else ' not defined.
 end select

Also a regex can help to analyze if the command and parameters structure is right.

Hope this helps

lolafuertes 145 Master Poster

In order to search by name, the text in the txtName must mach some entry in the DVD table in SQL.

If you defined the Name field in the SQL to be char or nchar, the legth is significant, because the content is filled with blancs in the db, so comparing without blancs can fail.

If you defined the field Name to be a BLOB (text, image, etc), is not serchable

If you defined the field to be char, varchar, nchar or nvarchar, the compare occurs as defined in the comparation method of the db: Binary, dictionary, case sensitive or not, etc, and for the nchar and nvarchar the compare is based on unicode while for the others is based on ascii. Also the base language for the SQL table plays in this scenario.

On the other question, you can add an option group with both possibilities: Search by ID, Serach by Name. Then, when constructing the select you can adjust the where clause accorging to the selection made asking if the option is checked.

Hope this helps

lolafuertes 145 Master Poster

Did you already read this article?
Pprobably the installer is asking for a DCOM component that is a requirement before the setup, but the DCOM is not already installed, or the version is not the right one.

On the referenced article there are many things to check.
Hope this helps.

lolafuertes 145 Master Poster

There is a control collection in the tab page that contains the controls and containers in the tab. Each container contains a controls collection that can be containers and/or controls. So the structure is recursive, an can be easely navigated to discover the controls and containers and, according to those discovered, create/add new containers controls on the destination page with the same structure.

Maybe, a memberwise clone of the tab page can also do the tric.

Hope this helps

lolafuertes 145 Master Poster

Wich is the structure of the text file?
Are you selecting by index (in the same order that the original text) or the values in the listview are sorted in a distinct way?

Are the items in the listview having subitems? In this case, are relevat to the text file contents?

Did you need to delete the content of the text file or you can create a new temp file from remaining content in the listview, and then rename the old to .old then rename new to the right name??

Please, let us know.

lolafuertes 145 Master Poster

I sounds taht at each frame, you open and close the writer, overwritting the content.

I woudl move the

AVIWriter writer = new AVIWriter("DivX");

to the private variables definition before the

public Form1()

then i'll move

// create new AVI file and open it
writer.Open("test1.avi", 640, 480);

to the button1_click, before

finalvideo.Start();

then, on the button1_click i'll put the

writer.Close();

before

this.Close();

Hope this helps

lolafuertes 145 Master Poster

Can you be so kind to put here the code failing? Is difficult to find error with only the message: some thing is not workinf fine. The error message you post says nothing to any developer.

Trying to help:
Did you checked the regional settings and language are all the same in both machines?
Did you provided mechanisms to convert numbers and dates to the invariant culture before accessing the database?

Hope this helps

lolafuertes 145 Master Poster

Sorry. Too fast reading. Anyway, naming is relevant to find errors.

lolafuertes 145 Master Poster

You can check the connection state to be open.

lolafuertes 145 Master Poster

Some hints:
1) on the form load is not necessary to fill 3 times the DsKK3DB.Staff.
2) if you use StaffBindingSource, wich one is the datasource for it? Is it initialized before doing endEdit? Is there any Edit pending?
3) please, post the full error message in order to understand better the issue.

Hope this helps

lolafuertes 145 Master Poster

The message you receive means that on a OleDb command you must use and OleDb connection, not an AdoDb one.

Hope this helps.

lolafuertes 145 Master Poster

If you go in the properties of the project, in the settings tab you can see the connection string used.
Then, if you go in the designer part of the form, yu'll find all the struff Visual Studio created.

The easy way to do what you want is to add to the form a binding source, an a binding navigator. Here a how to video.

Hope this helps

lolafuertes 145 Master Poster

Maybe you are interested in this article

lolafuertes 145 Master Poster

Did you already tryed to mount it as secondary hdd in another computer and read the disk content?

lolafuertes 145 Master Poster

@jgat2011: Having an auto increment field as primary key is not always a good idea. Ex: assume a table for the states. If you define PK SatateId as integer autoincrement, and a field stateName as a string, you can insert the same stateName in the table without error.

Continuing from the Reverend Jim, maybe need to use SQL sentences like:
IF NOT EXISTS (SELECT Staff_Id FROM Staff) INSERT INTO Staff (Staff_Id,Staff_Name, Staff_IC,Staff_Ext,Staff_HP,Staff_Email,Staff_Position) VALUES ('" + txtId.Text + "','" + txtName.Text + "','" + txtIC.Text + "','" + txtExt.Text + "','" + txtHP.Text + "','" + txtEmail.Text + "','" + txtPosition.Text + "') ELSE UPDATE Staff SET Staff_Name = '" + txtName.Text + "', Staff_IC = '" + txtIC.Text + "', Staff_Ext = '" + txtExt.Text + "', Staff_HP = '" + txtHP.Text + "', Staff_Email = '" + txtEmail.Text + "', Staff_Position = '" + txtPosition.Text + "' WHERE Staff_id = '" + txtId.Text + "';"
where, in first place, searches for the id if exists, then if not exists inserts, but if already exists updates.

Hope this helps

Reverend Jim commented: Excellent point but watch out for SQL injection. +9
lolafuertes 145 Master Poster

Assumming you have 2 applications, lets say A and B.
Application A has a main window and some children windows that can be opened or not.
From application B you want to be able to know if is opened, and to close, any child window of application A.
If my assumption is right, application A needs to be compiled as COM+ and expose some public properties and methods to be called from external applications, designed for those purpose. Maybe a wrapper is also needed.
Then application B needs to include a reference to application A wrapper, and create the application A object inside the application B. Then, using the public exposed methods and properties you should be able to close the desired windows.

For som example, you can take Excel. See http://msdn.microsoft.com/en-us/library/aa188489(v=office.10).aspx

lolafuertes 145 Master Poster

Usually, when this happens, in the build log or in the errors tab you should have some info about the error found. Can you be so kind to post it?

lolafuertes 145 Master Poster

In the program, create a temporay table with the same structure you need to print the receitp. Clear any row, and add a row with the relevant data.
Then use this table as source for the CristalReport.

lolafuertes 145 Master Poster

Did you use saveJpeg(IMAGE_PATH + (SCANNING_NUMBER in one place and File.Copy(flName, TEMP_IMAGE_PATH + (SCANNING_NUMBER

If not both paths are the same, from wich one do you show the images?

Hope this helps

lolafuertes 145 Master Poster

I am not an expert on Pocket PC but, in general, is a good practice to allways use the fully qualified namespaces in order to avoid this kind of errors.

lolafuertes 145 Master Poster

Please, be so kind to help us. What do you did so far?

lolafuertes 145 Master Poster

Do you tryed some thing so far?
Did you created a project with a form?
In this form , do you added the labels, and the corresponding text boxes to enter the data needed?
Also, do you added a response label and textbox? And a button to start the calculation?
Did you added an event to the button click to know when the user wants to do the calculation?
In this event, do you validate the correcness of the input data?
Do you wrote the formula calculations?
And, Do you put the result in the result text box?

Please, let us know.