lolafuertes 145 Master Poster

Did you tryed some thing like this

Maybe you can explore this way.

Hope this helps

lolafuertes 145 Master Poster

I the link I send you, to create the session calls to Lotus.NotesSession, not Notes.NotesSession.

Please, verify in your registry the one defined.

Hope this helps

lolafuertes 145 Master Poster

If the new object to set, is structurally distinct of the previous one, set the property grid to a new one(oldpropertygrid = new PropertyGrid;), then set the selected object.

Hope this helps

lolafuertes 145 Master Poster

Yeah. That's it. :)

Glad to knw the problem is solved.

Thanks for your feedback.

lolafuertes 145 Master Poster

So, please, be so kind to mark this thread as solved.

Thanks in advance.

lolafuertes 145 Master Poster

Please clarify 'but the program is not working'.

If you run the application from the Visual Studio (F5), is it working fine? If yes,

* Inside the application source folder, did you found any exe file? If yes,
** Is it located in a folder called bin? If yes,
*** Did you found any other files like .dll or .res in the same folder?

* Did you created an installation project to deploy the application? If yes,
** Did you tryed to deplñoy in a test pc other than developper? If yes,
*** There where errors?
*** The deployed application starts?

Any additional info you can provide will be helpful.

Thanks in advance for the info

lolafuertes 145 Master Poster

You need to have almost to threads (or processes) to handle this situation
1) You'll need an interrup server for each source that will receive each interrupt and add the relevant info into a list. During the process of the interrupt you need to discard any other call to the same interrupt using a processing flag.
2) The second will verify if the list is not empty to get the info from position 0 in the list, remove this position from it and process the relevant interrupt (maybe you need a backgroud worker for that process). In this thread, do not forget to call as many DoEvents as you can.

In order to manage the list, you will need an object (generic) to be locked by each process to access the list, then free it.

The list can be an inmemory list or, if you need persistence, and the response time is enough fast, you can use a table in a database to handle the list.

Hope that those ideas help you.

lolafuertes 145 Master Poster

What is the database structure? and what code had you written so far?

lolafuertes 145 Master Poster

Assume you have a text file in the path \\MyServer\MyShare\Myfolder\MyFile.txt

var PathToTheFileInTheServer = "\\\\MyServer\\MyShare\\Myfolder\\MyFile.txt";
var sourceFileInfo = new System.IO.FileInfo(PathToTheFileInTheServer);

Then you should be confident than source file exists

if (!sourceFileInfo.Exists)
{
    // nothing can be done
    return;
}

You can use ...

var tempFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + System.Windows.Forms.Application.ProductName;

to obtain an application temp folder path within the local application data folder.
Then with

var dirInf = new System.IO.DirectoryInfo(tempFolder);

yu'll get the info about this temp directory. Then, if the directory does not exist, you must create it using

if (!dirInf.Exists){
    try
    {
        dirInf.Create();
    }
    catch(Exception exception)
    {
        // show a message box explaining the error or take any relevant action
        // in theory, you should be able to create it
    }
}

Then you need to delete the destination temp file if already exists

var destinationFilePath = tempFolder + "\\" + sourceFileInfo.FileName;
var destinationFileInfo = new System.IO.FileInfo(destinationFilePath);
if (destinationFileInfo.Exists){
    try
    {
        destinationFileInfo.Delete
    }
    catch (Exception exception)
    {
        // show a message box explaining the error or take any relevant action
        // in theory, you should be able to delete it
   }
}

Then you can copy the file to the temp folder

try
{
    sourceFileInfo.CopyTo(destinationFilePath);
}
catch (Exception exception)
{
        // show a message box explaining the error or take any relevant action
        // in theory, you should be able to copy it
}

Finally you can launch it

try
{
    System.Diagnostic.Prcess.Start(destinationFilePath);
}
catch (Exception exception)
{
        // show …
lolafuertes 145 Master Poster

Glad to know. Then, please, be so kind to mark this thread a s solved.

lolafuertes 145 Master Poster

I don't used this softwares, but, IMO, you should be able to record every action.

Hope this helps.

lolafuertes 145 Master Poster

The difference, in the tests i did, is that the ConfigurationSettings.AppSettings is always returning an empty array (??), so it is currently compiling without error, but not working to me (VS2010 .NET 4.0).

Hope this helps.

lolafuertes 145 Master Poster

You can start here, here (5 articles) orhere for basic concepts and examples.

Hope this helps

lolafuertes 145 Master Poster

One esy way is to 'invert' the if like

protected void btnUpload_Click(object sender, EventArgs e)  //upload file function
    {
        //Condition for fileupload
        if (!Uploader.HasFile)
        {
            //display error message
            lblUploadResult.Text = "Error!!!: Please Upload Something. <br />";
            lblUploadResult.ForeColor = System.Drawing.Color.Red;
            Popuplate_DDL();
            return;
        }
        if (!CheckFileType(Uploader.FileName))
        {
            lblUploadResult.Text = "Error!!!: The file extentions that are allowed are: .txt, .log, .cfg, .doc, .docx. <br />";
            lblUploadResult.ForeColor = System.Drawing.Color.Red;
            Popuplate_DDL();
            return;
       }
       if (Uploader.PostedFile.ContentLength <= 1000 || Uploader.PostedFile.ContentLength >= 10000)  //Maximum content length
       {
            //display error message
            lblUploadResult.Text = "Error!!!: There must be more than a 1000 characters and less that 10000 characters. <br />";
            lblUploadResult.ForeColor = System.Drawing.Color.Red;
            Popuplate_DDL();
            return;
       }// if file size is out of range
       try 
       {
            string PathName = Server.MapPath("~/assets/uploads"); //get path name
            string FileName = Uploader.FileName;
            string FileSrc = Path.Combine(PathName, FileName);

            //Disable Overwrite
            if (File.Exists(FileSrc)) 
            { 
                //Display Message
                lblUploadResult.Text = "Error!: File " + FileName + " already exists. <br />";
                lblUploadResult.ForeColor = System.Drawing.Color.White;
                Popuplate_DDL();
                return;
            }
            Uploader.SaveAs(FileSrc);
            lblUploadResult.Text = "Result!: File " + FileName + " has uploaded successfully. <br />";
            lblUploadResult.ForeColor = System.Drawing.Color.Green;
            string[] FileInfo = { PathName, FileName, FileSrc };
            Session["FILEINFO"] = FileInfo;
       }
       catch (Exception ex)    //exception trap
       {
            //display error message
            lblUploadResult.Text = ex.Message;
            lblUploadResult.ForeColor = System.Drawing.Color.Red;
       }//catch
        Popuplate_DDL();
    }

I did not tested if I miss some thing, but there is the idea on how to.

JetBrains Resharper is an utility I use that helps a lot revamp your code.

Hope this helps

lolafuertes 145 Master Poster

The first way:

http://msdn.microsoft.com/en-us/library/y973b725.aspx

The open mode default option is Open or Create.
The access default option is Read-Write.
The file share default option is None.

When you launch a process with a file name, the OS searches for the default application to open the file, then applies the defaults to open the file with the application. This is by OS design.

If you need to opena file in 'shared' mode, you must specify it.

The second way:

If the user should not change the file contents, it can be copied into a temp folder and openen it from there (you will preserve the original from being modified).

Alternative: You will need 2 (or more) users modifying the same file, at the same time. Unless it is a database, IMO, there is no way.

Hope this helps

lolafuertes 145 Master Poster

You are using an obsolete deprecated method to retrieve the application settings.
I would prefer to use

SqlConnection con = new SqlConnection(System.Properties.Settings.Default.radicalGuard);

Hope this helps

AngelicOne commented: thanks +1
lolafuertes 145 Master Poster

Did you already visited this site?

lolafuertes 145 Master Poster

You can mark the server file as readonly. This will permit to be read by more than one client at a time.

Another way: Copy the server file in to an application temp folder in the current user profile and launch it from local. The temp folder can be cleaned at application shutdown and/or start.

Hope this helps

lolafuertes 145 Master Poster

but I'm having truble setting the value of the private variable with the values returned but a single SqlDataReader:

Can you be so kind to clarify?

lolafuertes 145 Master Poster

I am glad to help.

I this solved your problem, please be so kind to mark this thread as solved.
Thanks in advance.

lolafuertes 145 Master Poster

Any instantiable object can have his own instantiated dataset.
Ie: each form in an application can have his own dataset. When you write var f = new form1; a new instance of the form is created and, if the form has a var ds = new dataset; this willalso be instantiated with th form.

The datasets ca be passed by reference so there is no problem to deal with several public datasets from instantiated objects.
Any way, i am almost sure you can define a

DataSet PublicDataset {get;set;}

and it will work

Hope this helps

lolafuertes 145 Master Poster

Instead of selected index, you need to use the selected item, and in the from clause of the select statement, you should remove the apostrophes.

Ie:

var tableName = comboBox1.SelectedItem as string;
string str1 = "select * from " + tablename;

and in the ad.Fill(ds1) the can try

ad.Fill(ds1, tableName)

Hope this helps

lolafuertes 145 Master Poster

I would appreciate if you mark the thread as solved.

TIA

lolafuertes 145 Master Poster

Imagine:

Your size parameter is 1024.

You start a loop to launch 1024 threads.
After each thread is started, you freeze your thread working for 100 miliseconds.
Then you try to finalize the launched thread and freeze yours until the thread finishes.
And start over for 1024 times.

I would suggest:
1) instead of freezing your application for 100 miliseconds, replace it by a System.Windows.Forms.Application.Doevents, to allow others threads to start processing.
2) Move the is alive and join out of the launch loop.
3) start a new loop for joining the threads.
4) before and after the join sentence, put a new doevents.

Hopefully this will 'unfreeze' (almost a little bit) your application.

Hope this helps

lolafuertes 145 Master Poster

So, please be so kind to put your solution, and mark this thread as solved.

Thanks in advance

lolafuertes 145 Master Poster

@izyrider: agreed with you.

lolafuertes 145 Master Poster

and your question is how to reduce the number of parameters of your stored procedure?

A possible approach may be splitting the update in several steps all under the same transaction.
Another approach is not to use a stored procedure, intead use and adhoc query from your application.

Hope this helps

lolafuertes 145 Master Poster

you can define a c# helper class holding all the public static variables, and having a ClassInitialize static method (mybe with parameters) to initialize all the static variable you'll need.

This methol should be called fom the New procedure of the starting form or from the static void Main from the starting program class.

Hope this helps

lolafuertes 145 Master Poster

Yopu can use a BackgrounWorker. See some example on how to here

Hope this helps

lolafuertes 145 Master Poster

Remove te offending cotrol from the Panel.Controls collection, or fully clear the panel.Controls before adding the new user control.

Hope this helps

lolafuertes 145 Master Poster

And your problem is?

lolafuertes 145 Master Poster

Can you be so kind to post the properties of the datefield in your database?

TIA

lolafuertes 145 Master Poster

If I understood well, you need to create and ad hoc query on the VB application with a variable numer of conditions depending on some rules.

I will suggest you to create a variale where clause like in the following example:

Dim strQuery as String = "SELECT * FROM table WHERE 1=1 " ' do not foret the space after
Dim strWhere as String = ""
'
' here go the rules
'
If var1 > 6 then
    strWhere &= "AND F1 = " & var1 & " " ' again not forget the space
End If
If var2 > 6 then
    strWhere &= "AND F2 = " & var2 & " "
End If
.
.
.
Dim Commandtext as String = strQuery & strWhere

Hope this helps

lolafuertes 145 Master Poster

The primary key fields should not be updated. IE: if you have an orderid = 23 is not a good practice to change it to 24 in the table orders and expect that all the related records on the processes tables will change automatically to the new key value.

Anyway, you can do it. In order to do so, all the relations (all the involved relations) between tables must be defined to update the related records in the child tables on the relations screen.

Hope this helps.

lolafuertes 145 Master Poster

Did you create an msi for publishing?

lolafuertes 145 Master Poster

Cam you post the Db structure and the profile form as far you have defined them?

TIA

lolafuertes 145 Master Poster

IMO, before ad.Fill(ds3, "sccl_et"); you need to empty the table with ds3.Tabres[0].Clear; Hope this helps

lolafuertes 145 Master Poster

With pleasure. But how can we help you?

lolafuertes 145 Master Poster

Are you sure that the internal format of the dbf file is dBASE IV?
There are many formats to manage depending on the utility used to create the dbf file(dBase, Clipper, etc.)

Did you already tryed to import in an access database to verify if the format is valid?

lolafuertes 145 Master Poster

Your data adapter Insert, Update and Delete commands had not been defined or are written wrong way.

Please, can you be so kind to show us you data adapter definition and commands? Also show how you use them, if this is possible.

TIA

lolafuertes 145 Master Poster

Can you post your written code here?

TIA

lolafuertes 145 Master Poster

Just some hints:
1) Compare the creation date of the executable file to the current one.
2) Create an entry in the rgistry with he installation date an chage the permission to this key to r3ead only.
3) Use a property setting in your application to be filled if empty with the current date, and another with a number of times being used. At each start, verify the date and decrease the number of remainig trys to execue.
4) Create a hidden system file in the user roaming with a name starting and ending with $ holding an encrypted value corresponding to the first usage date.

etc.

Hope this helps

lolafuertes 145 Master Poster

When the user click on the button to search you must:
1) Open a connection to the database, if not already open. (you already written some piece of code on that)
2) Create a SELECT command to search the free dates. That will depend on your database design, if you already have one.
3) fill a datatable with the answers from the slect command usind a data adapter
4) bind the datatable to a grid or list view to show the results.

Hope this helps

lolafuertes 145 Master Poster

And the problem is ...

lolafuertes 145 Master Poster

As AppExamSchedule is autoincrement, you should create a transaction that, first inserts the values in the AppExamSchedule, then selects the highest Id in this table and uses the returned value to insert in the AppInfo table before commiting the transaction.

Hope this helps

lolafuertes 145 Master Poster

The best way is to create the queries/views in access and test them.

Then use the access queries/views as a data table in a data set, and fill them using a data adapter with 'SELECT * FROM MyAccessQuesryOrView'

Hope this help

lolafuertes 145 Master Poster

Please, can you clarify what do you mean with 'repeated records'?
a) Allways show the same records at every refresh of the datagrid
b) All the rows shown have the same values
c) At every refresh, the data grid increases the number of rows, and the content of the new rows is exactly the same of the old rows

Thanks to clarify

lolafuertes 145 Master Poster

A stored procedure handling all necessary variables is a god solution to isolate he problem of inserting from your application.

Hope this helps

lolafuertes 145 Master Poster

If you use a dataset, the data adapter will fill it with the data according to the select.

If the select references a query in the server, the server executes the query and returns the result to the datase.

Instead, if you fill the dataset with all the data from the table, and then apply a view to filter the data, you are wasting memory and bandwith.

Lets do some examples. Imagine you have a nice table of 16GB of data with an structure of a recordId, recordDate, recordAmount and recordQuantity. Then you need to retireve only the rows having the highest quantity (a priori you don't know wich one is/are)

If you fill a datatable with 16Gb of data ... well you know what will happen to your application.

Instead, you can fill the table using 2 techniques to obtain the desired result:
+ Create a query in the server that always returns the rows having the highest quantity [SELECT * FROM MyLargeTable WHERE recordQuantity = MAX(recordQauntity)] and use a SELECT * FROM MyServerQuery for the dataadapter to fill your datatable or
+ Create an adhoc query like SELECT * FROM MyLargeTable WHERE recordQuantity = MAX(recordQauntity) for the data adapter.

While the first solution is partially known by the server, already compiled, permissions tested and the execution plan is loaded the first time you execute it when you send the adhoc query for SELECT * FROm MyServerQuery, the second one will …

lolafuertes 145 Master Poster

Just because your array being added to the arraylist is the same for each instance.

If you do not create a new array inside the for each loop, the array memory address is always the same (never changed), so, even added several times to the array list, internally the array list only contains the addres of the unique array being added (n times). A change to any of the items in the array list will change all.

You need to create a new array to hold the data, then fill it, then add to the array list, and start over for the next instance.

Hope this helps