lolafuertes 145 Master Poster

Which is the expected content of the file to be?

lolafuertes 145 Master Poster

Please post the errors.

lolafuertes 145 Master Poster

There is a 'solved' button. Please.

lolafuertes 145 Master Poster

Hi ada9452. If this solved the issue, please mark this thread as closed.

sincerely.

lolafuertes 145 Master Poster

I will suggest to repair the Xp installation from the original CD. It seems that some relevant files had been removed or damaged.

Hope this helps

lolafuertes 145 Master Poster

I will comment a few points:
1) You need to validate that the userMsg is a valid number between 3 (because is the minimal value acceptable for 3 random integers starting at 1) and the Integer.MaxValue. If it is not, you must launch a message and exit the sub.
2) The second parameter of the function Next of the GenerateRandom random generator, is the max value to generate, so here you must pass the integer value represented in the userMsg.
3) Before starting the generation of random numbers, you need to create a integer loopCounter initialized to 0, to count the loops.
4) Assign the value of 0 to the Random1, Random2 and Random3 before starting the random number generation.
5) To verify the rightness of the returned values, you must also verify that the Random1 is not equals to the Random2.
6) You must assign your returned values to some label to be shown. If you assign an Integer to a Text, VB automatically uses the default method ToString to convert the integer to string.

You can just change the code to some thing like this untested code:

Dim userMsg As String = InputBox("Please Enter A Number?", "Integer", "Enter your integer here", 500, 700)
Dim GenerateRandom As New Random(DateTime.Now.Millisecond)
Dim Random1 as Integer = 0
Dim Random2 as Integer = 0
Dim Random3 as Integer = 0
Dim loopCount as Integer = 0
Try
    Dim m as Integer = CInt(userMsg)
    If …
lolafuertes 145 Master Poster

How many fileToolStripMenuItem_Click have you? Probably you have almost the standard one (fileToolStripMenuItem_Click) and the one exibited here(fileToolStripMenuItem_Click_1 created after you deleted)

Please, go to the form designer and verify wich one is the delegate for the event click of the fileToolStripMenuItem.

Hope this helps

ddanbe commented: Good observation! +14
lolafuertes 145 Master Poster

If you can work disconnected from the server, yes, ity is necessary to have the same info in the server than in the client to have access to the info for sections, subjects, etc. needed during the enrollment process.

But the synch option can be assimetric: From the server to the client all tables, but from the client to the server only Student.

Hope this helps

lolafuertes 145 Master Poster

The rror code returned should be 0 or non 0? In the first piece of code you ask for non 0 (line 40), while in the second you ask for 0 (line 38).

Also on the first piece of code you miss to call the SysytemParametersInfo.

Hope this helps

lolafuertes 145 Master Poster

On your first post, I understood to ahow every five seconds to show a row.
On your last one, are you saying every 30 the hole database info?

Please elaborate

What is unclear for you?

I think I described, every sentence and the exact place to put each, all what you need to do modify the piece of code you wrote here.

Please le us know

lolafuertes 145 Master Poster

Glad to know.
Then, please be so kind to mark the thread as solved.
Thanks in advance.

lolafuertes 145 Master Poster

Before you start reading data you'll need a timer

Dim WithWEvents ReaderTimer as Timer = new Timer

In order to define a withevents timer, you must do so on the class level.

Then, in this sub, initialize it to 5 seconds interval.

ReaderTimer.Interval=5000 ' In thousands of seconds

And Start the timer

ReaderTimer.Start

Also, you'll need a interval read permission like

Dim CanRead as Boolean = Flase

to be defined in this sub.

Then, before the Loop sentence you should add

Do
    Application.Doevents()
Loop Until CanRead
CanRead = False

This will put the application in a wait state until the timer is fired.
Before the myData.Close() you should stop the timer with

ReaderTimer.Stop()

In order to catch the Tick event from the ReaderTimer you should create a new sub

Sub RederTimer_Tic(myObject As Object, _
      ByVal myEventArgs As EventArgs) Handles ReaderTimer.Tick
    CanRead = True
End Sub

None of this code has been tested, but I hope this helps

lolafuertes 145 Master Poster

Because TextBox8.Text is just a string you should convert to some kind of numeric (like double) to add it to another value like:

TextBox8.Text = String.Format("{0:C2}",CCur(ds.Tables(0).Rows(0)("Price")) + CCur(TextBox8.Text))

This will format the result as a currency, with 2 decimals. Each operand will be converted to currency before being added together.

Hope this helps

lolafuertes 145 Master Poster

@ChrisPadgham: using a GUID column accomplishes this according to this MSDN article.

Hope this helps

lolafuertes 145 Master Poster

Just my cent.
If you only will provide a gui for the application, you can add a form that will be the gui for it.

The form must contain the necessary info an controls to be able to call the right methods or functions you already defined.

Usually, on the main procedure, you will check if the environment is user interactive to show the form, unless a parameter in the call to the application asks for not to use the GUI.

If you must show the form, then show it as dialog, and end the application when the form is closed.

Hope this helps.

lolafuertes 145 Master Poster

Can you be so kind to post what you coded so far?

lolafuertes 145 Master Poster

You can find some examples here

Hope this helps

lolafuertes 145 Master Poster

If each time you call this button, you set the text value to 0, the old value is lost.

I would suggest to remove the line

TextBox8.Text = 0.0

from there and move it in an outer initializer sub.

Hope this helps

lolafuertes 145 Master Poster

Do you have a backup of your machine?

Wich OS, version and patch level are you using?

In the control panel folder options, did you checked all the show options and unchecked the hide ones?

Did you searched for Protect in all the machine?

Let us know

lolafuertes 145 Master Poster

As this is a project for a tesis, i will suggest the following:
Tables on both databases must have a global unique identifier field and also a synchro time field, and a row status (syncronized, updated, inserted or deleted).
In order to optimize the access to this info this can be included in a Index using both fields.

On the client side, you must have a database selector to connect to the server database, the client one or both depending on the connection status of the client machine.

You can determine if the server is connected (or accesible) trying the connection to the server each time you need to do a transaction (select, insert, update or delete). It would be appropiate to have a data layer class that manages all this stuff.

When you first connect to the remote server, you set the connector for transactions to the remote server.

At this time, you can start a bacgroud worker that, for each row in each table of the server database, will compare if the corresponding GUID exists on the local one, and if exist and the synch time in the local is lower than in the server, then update the row to the server values, and update both to sync status and to time now [Just get the time once and write to both]. If not exist in the client and the server status is not deleted then insert the row in the client …

lolafuertes 145 Master Poster

Also you can modify slightly your code to not include the short lines like:

Dim FILE_NAME As String = "C:\Users\Owner\Documents\test.txt"
Dim TextLine As String

If System.IO.File.Exists(FILE_NAME) = True Then

    Dim objReader As New System.IO.StreamReader(FILE_NAME)

    Do While objReader.Peek() <> -1
        '
        ' Red a line
        '
        Dim CurLine as String = objReader.ReadLine().Trim() 
        '
        '  Add it only if length > 5 
        '
        if Curline.Length > 5 then TextLine = TextLine & Curline & vbNewLine
    Loop

    Textbox1.Text = TextLine

Else

    MsgBox("File Does Not Exist")

End If

That is only another way.
Hope this helps

lolafuertes 145 Master Poster

A 2 dimension array means that all the items, in both dimensions, must be of the same type. If the columns in the datatable are not of the same type, this can not be implemented.

While the solution from Oxiegen uses ArrayLists, and is a very good solution for unknown types of items, the solution from ChrisPadgham uses less overhead but needs to know in advance the types and the number of elements.

Also there is an intermediate solution: use a undefined length 2 dimensions array of a known type, then enlarge the array as needed.

To define the array (lets say of integers) you can use:

Dim TwoDimensionsArray(,) as Intgeger

Then on the loop to fill the array from the datatable you can write something like:

Dim R as Integer = -1
For Each row As DataRow In <datatable>.Rows
    R += 1;
    If TwoDimensionsArray Is Null Then
        ReDim TwoDimensionsArray(0,1)
    Else
        ReDim Preserve TwoDimensionsArray(R,1)
    End If
    TwoDimensionsArray(R,0) = row("first column")
    TwoDimensionsArray(R,1) = row("second column")
Next

The ReDim Preserve sentence copies the current content in a new memory address and allocates as many space as requested. Depending on the size, this solution can have more (or less) overhead than the one of ArrayLists depending on the number of elements. Allways will have more overhead than the solution of knowing the right size.

Hope this helps

lolafuertes 145 Master Poster

To close a form use the Close() method of the form to close.
To open a form, you must first instantiate the form, then use the Show() or ShowDialog() method of the form to 'open' it.

If you need futher help, please post your code.
Hope this helps

lolafuertes 145 Master Poster

Thanks for the info.
I assume you can close this threat.

lolafuertes 145 Master Poster

Setting the controls private will not permit external access to them.
If you want to make their properties read only to external, then create properties in your control exposing the internals.

lolafuertes 145 Master Poster

Sorry again, but the phrase

It didn't work at all.

still not clarify the problem you have on 'another PC'.

Please be so kind to confirm if I am missing something:

On the target PC you installed the following:

  • SQL Server, the same edition you have on your machine with the same patch level, with the same instances than in your machine
  • .NET runtime required by your application

You already configured the server and client protocols in the target machine to support Shared Memory, TCP/IP and Named Pipes (and are configured in this order for the client)
Your program is connecting to the default instance of the SQL Server installed. (Is there a default instance on the targe machine or is installed with a named instance instead?)

You already created manually the database DANGKY in the target machine.

Then you install the program on the target computer and have no error during the install.

Then when you start your program in the target machine, nothing happens and no error is reported.

Is this the 'It didn't work at all'?

lolafuertes 145 Master Poster

@nndung179:The behaviour 'It doesn't work at all' is really not clarifying the kind of problem.
Did you tried to restore it maually in the targed PC to verify if there is any other problem?

@sirasingh: IMO your code works for Access databases, not for SQL Server ones.

lolafuertes 145 Master Poster

@sirasingh: nndung179 said:

It works perfect on my PC

.

Wich are the prerequisites of your code in the target pc where will be deployed the application in order to work?

lolafuertes 145 Master Poster

If you work with the selected rows, only those selected are used.

Try changing the loop to

For Each dgvRow As DataGridViewRow In dgvAccesList.Rows

Hope this helps

lolafuertes 145 Master Poster

The problem is that the get method returns itself. You should change it to return the InternetConnectionState:

[DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int desc, int reserved);
        public bool InternetConnection
        {
            get
            {
                int desc; // By default is initialized to 0.
                return InternetGetConnectedState(out desc, 0);
            }

        }

Hope this helps

lolafuertes 145 Master Poster

Here is a VB -> C# or viceversa converter

This is the result:

public interface IPlugin
{
  void Initialize(IHost Host);
  string Name {
    get;
  }
  double Calculate(int int1, int int2);
}

public interface IHost
{
  void ShowFeedback(string strFeedback);
}

public class Class1 : PluginSample.Interfaces.IPlugin
{
  private PluginSample.Interfaces.IHost objHost;
  public void PluginSample.Interfaces.IPlugin.Initialize(PluginSample.Interfaces.IHost Host)
  {
    objHost = Host;
  }
  public string PluginSample.Interfaces.IPlugin.Name {
    get { return "Example Plugin 1 - Adds two numbers"; }
  }
  public double PluginSample.Interfaces.IPlugin.Calculate(int int1, int int2)
  {
    return int1 + int2;
  }
}

public static AvailablePlugin[] FindPlugins(string strPath, string strInterface)
{
  ArrayList Plugins = new ArrayList();
  string[] strDLLs;
  int intIndex;
  Assembly objDLL;
  //Go through all DLLs in the directory, attempting to load them
  strDLLs = Directory.GetFileSystemEntries(strPath, "*.dll");
  for (intIndex = 0; intIndex <= strDLLs.Length - 1; intIndex++) {
    try {
      objDLL = Assembly.LoadFrom(strDLLs(intIndex));
      ExamineAssembly(objDLL, strInterface, Plugins);
    }
    catch (Exception e) {
      //Error loading DLL, we don't need to do anything special
    }
  }
  //Return all plugins found
  AvailablePlugin[] Results = new AvailablePlugin[Plugins.Count - 1];
  if (Plugins.Count != 0)
  {
    Plugins.CopyTo(Results);
    return Results;
  }
  else
  {
    return null;
  }
}

private static void ExamineAssembly(Assembly objDLL, string strInterface, ArrayList Plugins)
{
  Type objType;
  Type objInterface;
  AvailablePlugin Plugin;
  //Loop through each type in the DLL
  foreach ( objType in objDLL.GetTypes) {
    //Only look at public types
    if (objType.IsPublic == true)
    {
      //Ignore abstract classes
      if (!((objType.Attributes & TypeAttributes.Abstract) == TypeAttributes.Abstract))
      {
        //See if this type implements our interface
        objInterface = objType.GetInterface(strInterface, true);
        if (!(objInterface == null)) …
lolafuertes 145 Master Poster

As said before, you'll need to anchor the controls depending on the expected behaviour when resizing the application's window.

As an alternate way, on the form resize event, you can manually fix the size an position of each control depending on the current form size.

Also on this event, you can fix the min size of your application window.

Hope this helps

lolafuertes 145 Master Poster

If you right clich on an empty part or your screen, there is a context menú with a View submenú, that holds an option to 'align to the grid'.

Please, verify if it is checked or not.

Hope this helps

lolafuertes 145 Master Poster

Did you refresh the dgExperience after assigning the data source?

dgExperience.Refresh

Also the

dgExperience.Rows.Clear

before assigning the new data source, can help.

Hope this helps

lolafuertes 145 Master Poster

Any message from SQL Server management studio not working on the target computer?
Is the SQL Server installed on the target computer? If yes, is the version installed on yours exacly the same than in the target, with the same patches applied?

lolafuertes 145 Master Poster

@bhagawatshinde: I didn't agree with your solution, because changing the primary screen resolution will affect to all other programs running, and, if the application throws an exception, the resolution would be changed back manually by the uiser.

More over, if the computer has more than one screen (sysinternals can mount 4 virtual desktops)(some video cards support more than one monitor attached in desktop extension mode)(the current screen is a virtual one like when using RDP or VNC), do you will change the screen resolution on all the 'primary' screens if the user moves the application window from one screen (or monitor) to another?

The point, IMO, is how to anchor and resize the controls depending on the current application main window size.

Let me know your opinion.

BR

lolafuertes 145 Master Poster

A lot of possibilities:
1) The MS firewall is active and is blocking ftp connections.
2) The Anti-virus firewall is active and blocking ftp connections.
3) The ftp connection is using active mode, but passive is required.
4) The ftp connection is using passive mode but active is required.
5) The content of the directory is too large to be retrieved in the time out defined.

lolafuertes 145 Master Poster

Did you already installed the SQL Server Management Studio in the target computer?

lolafuertes 145 Master Poster

Use distinct anchorages for each button: Ie Button1 use top + left, Button 2 use bottom + left and Button 3 use top + righ

Hope this helps

lolafuertes 145 Master Poster

Another possibility is that the lan card is misconfigured at MAC level.
We need to know the card brand and model.

lolafuertes 145 Master Poster

I suppouse you already visited vanet.info and the wiki

lolafuertes 145 Master Poster

Mostly, if you get the IP 0.0.0.0 is because is fixed somewhere.

Maybe you can try to go to the Local Area connection properties, uncheck all protocols except Client for Microsoft Networks, File an Printer Sharing for Microsoft Networs and Internet protocol Version 4 (TCP/IPv4).

Then select the TCP/IPv4 and click on properties, verify that the options Obtain an IP address automatically and Obtain DNS server address automatically are both selected. If not, please note the current configuration and select them.
Then click on the advanced button.
On the IP Settings tab, verify that there are no defaults written.
On the DNS tab, verify there are no defaults written. Also the Append parent suffixes of the primary DNS suffix should be checked.
On the WINS tab, verify that there are no defaults.Uncheck the Enable LMHOSTS lookup option,and verify that the Enable NetBios over TCP/IP option is selected.
Click on OK, OK and OK.
Then disable and re-enable the Local Area Connection.

Hope this helps

lolafuertes 145 Master Poster

Do not fix the form size. Set the window state to Maximized.
Use a unique panel to fill the form. If the form size is less than expected, you can fix the panel to the desired size (+ scroll-bars size if needed).
Put all your controls inside the panel.

Hope this helps

lolafuertes 145 Master Poster

The very firs question is to know why is this happening.
I you have a virus, trojan, or any other malware, you must clean-up your computer first.

Is not guranteed that upgrading Norton will 'repair' your issue, but is guaranteed that if you still not updated, is easy to get a malware installed on your computer.

I would suggest to take your disk and attach as secondary in a clean computer with an updated antivirus. Then do a full scan of your disk and select the delete option if any infected file is found.

Then remount your disk in your PC and start in safe mode.
Verify wich Add-ins are placed in your browser and disable all of them.
Restart your ccomputer in normal mode.
Run the msconfig.exe utility (usually in the windows/system32 folder (or PCHEALT/bin)) and go to the startup tab, and disable all the startup programs.
Restart your computer start the msconfig.exe utility again and verify the Services running; note them, and verify the real utility of each running service. If is not really needed, disable (and note it). Restart once more.
Apply all the Windows Update pending patches. Restart as many times as needed until all are applied.
Renew you antivirus or uninstall it and install the free Essentials from Microsoft.
Do a full scan again.

Then Uninstall all the bars and internet accelerators. You do not need them.
Finally, re-enable one by one …

lolafuertes 145 Master Poster

I've seen this behaviour if almost one of the registry files has gone over a "defective" track in the disk, or, if you have a RAID disk (2, 5, or whatelse) one of the disk is failing an gets a lot of time to sync with the other(s).

I would suggest to do a full backup into an external disc, and then, run a CHKDSK with the /B switch (that will reevaluate the disk for bad clusters, bad sectors (and recover any readable info), and fix any common error in files or directories)

If any bad sector or cluster is found, you should replace the disk a.s.a.p.

Hope this helps

lolafuertes 145 Master Poster

Usually, when this happens, is because the connection to the server failed.
Depending on the type of account or connector there are several actions:
1) If the connetcor is an Outlook Hotmail Connector, is known that the very first connection to the server after a large period of inactivity can result in a message like you are experiencing, and also a Sync error would appear.

2) If the connector is an IMAP or POP, you can access to the account and verify the settings using the Test Account Settings. There is also the oportunity to verify all the other parameters to connect to the server (or servers), specially if the sender server is distinct than the receiver, and should have the same or distinc credentials.

3) An intermittent netwok problem or a very slow connection can also relay in the same behavior.

Hope this helps

lolafuertes 145 Master Poster

Please, be so kind to mark the thread as solved. :)

Begginnerdev commented: Marked as solved, sorry for the delay. +2
lolafuertes 145 Master Poster

You must understand that the class Q2 has 2 parts
1) The static part is shared between al the instances of the class
2) The non static part, is owned exclusively by the instance

In this class, the static part is represented by the private static int num initialized by default to 0. Each time is executed the sentence num++; the value is incremented and is visible for each instance.

The non static part is represented by the private string prefix; .
This will mean that each instance will have his own prefix, wich is loaded during the class instantiation new Q2("Question 2") or Q2 (“Another view ”) .

After doing the

Q2 var1, var2;
var1 = new Q2(“Question 2 ”);
var2 = new Q2 (“Another view ”);

you have a unique num variable, with a value of 0, and two prefix variables (one for var1 and another for var2) with the "Question 2" and the "Another view" texts.

Each call of the var1.Msg() function, will increase the value of num by 1. Then will return a string containing the current value of the num variebla, a - sign, the prefix value for the current instance and the string passed to the Msg function.

The infinite loop has the trick that always use the same naming for the instance, but is creating a new instance each time, so the stack vill increase having as many instances as iterations done, and the …

lolafuertes 145 Master Poster

The most common situation is assumming that the field is a string field, but is not.

Please, verify in the DB definition the field type, and use the apropiate get.
If you are unsure, using the GetValue(shtCntr).ToString (instead of Getstring(chtCntr))will try to get the field value, and then convert it to string.

Hope this helps

Begginnerdev commented: Thank you! +1
lolafuertes 145 Master Poster

Not from my knowledge with MySQL.

In MS SQL Server, you can add other servers as known servers, and do a distributed transaction. Maybe tou can read here for more info.