dickersonka 104

You need the user control to save its data, not sure what you need so can't give you any tips there yet. I don't know how they work, but you might be able to make them member variables on the form and never dispose of them.

My advice would be to set your area you want to display the user control in as a panel.
Upon clicking each menu item, you would have something like:

[CODE]
//Create control
//This might be a member variable instead
DeSched Deschedule = new DeSched();
//Clear controls
this.panel.Controls.Clear();
//Add control
this.panel.Controls.Add(Deschedule);
[/CODE]

dickersonka 104

Create all that code as a class, then you will be able to share that code in between multiple pages.

dickersonka 104

You really can't do this from the fileupload control. Based on certan ie permission settings, it won't always work in ie either.
My advice is to use either your own control and load the textbox value on postback, or use a 3rd party control.

You normally don't need, care, and so on....of what the path was on the client side.
You might want to rethink the way you are doing things if you need the client path.

dickersonka 104

Do you have the source you can show us where you are assigning the buttons?
Make sure you are adding the action listener from both buttons. Also assuming those two objects are buttons.

[CODE]
connect.addActionListener(this);
disconnect.addActionListener(this);
[/CODE]

dickersonka 104

As previously stated before it could be a lot of things. The schema doesn't look like it should take anytime to query regardless if indexes are in place or not.

When you are in this 10 min waiting phase, run this command on the database, just in management studio is fine.

[CODE]sp_who2[/CODE]

My guess, is that something is locking up these records. Might not be, but for just a basic table with a small recordset, something extraordinary is going on.

The thing to look at is the BlkBy column. Please report back your results

dickersonka 104

For one your command is named the same as your connection.

Make it like this and try to run it, then let me know what errors you are getting

[CODE]
SqlCeCommand command = new SqlCeCommand("INSERT INTO tblCustomers (Customer_Ref, Customer_Name) VALUE(@Customer_Ref, @Customer_Name)");
[/CODE]

dickersonka 104

Lots of moving pieces here. This most likely makes me think its a permission issue connecting to the database, but might not be.
Can you make sure your connection string is connecting as a single user to the database with the same host, regardless of the logging in user?
Any mysql errors or exceptions you are getting, other than user name not found?

dickersonka 104

Where are you setting the connection to the command? My advice is to not set the connection open on the form shown. Only use the connection when you are going to run a sqlcommand / query. That way, when you are done with it you can close it.

dickersonka 104

you can import the data, in management studio right click on your destination database and click import, then set up a mysql connection to your other database

depending upon how mysql specific the queries are, they could most likely be used as well, just swapping out the connection strings

dickersonka 104

i think you are concerning yourself with the id's when you actually don't need them here, you know the order already

page 1
select * from table
limit 1 offset 0

page 2
select * from table
limit 1 offset 1

if you are doing ordering, just add the order by, and it will work the same

dickersonka 104

You have to show us what you got before we can help you

dickersonka 104

you need to have an open connection, just as it says, right before you call execute reader call this

[CODE]
if (conn1.State != ConnectionState.Open)
{
conn1.Open();
}
[/CODE]

also it would be a good idea to create a separate class or method for calling all sql functions, that way you don't have to worry about closing and opening except in a single place

dickersonka 104 Veteran Poster

A common question that routinely comes up is how to share data between forms.

I have outlined two common ways to pass data between forms, among many others. I have used a public property on the output form to accept a value and update the display. I also have a method accepting parameters from the input form, to update the display.

On the first form there are three textboxes tbFirstName, tbLastName, and tbSample with a Submit button to redirect to the output form. I have the same layout on the output form to display the passed values.

dickersonka 104

ahhh, so for every record that exists in acts you are needing an update

my advice would be to use a sql 'for each' loop, you can use a cursor and iterate through each row and execute the update statement in there

dickersonka 104

[quote]If I add a distinct clause to the statement, only 9 records are returned from the budget table.
[/quote]

are you sure you are needing to do 34 updates, 9 records only need 9 updates

if the update isn't working properly, can you give us a little more of the schema and also what the distinct column is?

dickersonka 104

whether it is buttons or textboxes, still the same concept

[code]
//form 1
frmKeypad frmKey = new frmKeypad();
frmKey.ShowDialog();
this.btnQuestion.Text = frmKey.SelectedKey;

//form 2
private string selectedKey;
public string SelectedKey
{
get{ return selectedKey; }
}

//sample with just one button
private void btnOne_Click(object sender, EventArgs e)
{
this.selectedKey = "1";
}
[/code]

you can get creative with this and use a more generic method of doing this, but those are the basics

dickersonka 104

here's a link on a small little sample i did for that

[url]http://alleratech.com/blog/post/Sharing-data-between-forms-with-C.aspx[/url]

dickersonka 104

could be done without it, i think you would have to parse and eliminate the extra escape characters then convert it to a byte array using encoding getbytes

i might be wrong, but just a shot

dickersonka 104

dickersonka 104

think this is what postgre calls bytea

check out this
[url]http://docs.huihoo.com/enterprisedb/8.1/dotnet-usingbytea.html[/url]

25.15.1. Retrieving the BYTEA Column Using .NET Code

hopefully that can be a good start

dickersonka 104

pretty much the same thing

the important piece being this line

[code]
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler (Application_ThreadException);
[/code]

unless you want to use it to catch exceptions that you didn't handle already, its not a recommended solution for error handling

dickersonka 104

Not really

Its good practice to handle the exceptions as they occur and decide if you can move on or pass back a specific error message

Here is an example of what you might be looking for though
[url]http://stackoverflow.com/questions/337702/c-how-to-implement-one-catchem-all-exception-handler-with-resume[/url]

dickersonka 104

you are trying to run the jar file

do you have this in there?

[code]
public static void main(String [] args)
[/code]

i'm assuming you don't, but for a jar file to be run, just like any other code, it needs to start with a main method

dickersonka 104

i should add to this, both really have their place

normally you would use these instance methods when they pertain to particular class, lets says a single point of reference for a connection string inside a configuration class

and for the static variables without instance you could use as formatting a string to remove all spaces

i sort of like to put them in the terms of Utility (static) vs Instance (Non utility)

dickersonka 104

when using this

[code]
public static int Result4, Result6 = 0;
public static Assembly DMUAssembly;
[/code]

there is no need for a singleton, they are static variables

when using this
[code]
public class GlobalVariables
{
private static readonly GlobalVariables TheSingleGlobalVariableInstance = new GlobalVariables();

    private GlobalVariables()
    {
            result6 = 5;
    }

    public static GlobalVariables  Instance
    {

get
{
return TheSingleGlobalVariableInstance;
}
}

private int result6;
public int Result6
{
get{ return result6; }
}
[/code]
you have to access the variables through the instance of that class

also notice i took away the set public method in there, that allows these properties to be readonly from outside that class

depending upon the need, you may or may not want to do it that way

dickersonka 104

The problem with that would be is that its not a singleton and can exist in multiple classes

[code]
private static readonly GlobalVariables TheSingleGlobalVariableInstance = new GlobalVariables();

    private GlobalVariables()
    {
    }

    public static GlobalVariables  Instance
    {

get
{
return TheSingleGlobalVariableInstance;
}
}
[/code]

The above piece allows only a single instance to exist in the application, which can be called by any class without creating an instance of it

[code]
//you can do this
GlobalVariables.Instance.Result6 = 5;

//you can't do this
GlobalVariables gv = new GlobalVariables();
gv.Result6 = 5;
[/code]

you normally would use this singleton method for a configuration accessor class or a group of data that needs to be shared throught the app without passing a class object around

ddanbe commented: good explanation +4

dickersonka 104

i only saw part of the output, what format is this output in?

dickersonka 104

you are mixing static with singleton here

try this way
[code]
public class GlobalVariables
{
private static readonly GlobalVariables TheSingleGlobalVariableInstance = new GlobalVariables();

    private GlobalVariables()
    {
    }

    public static GlobalVariables  Instance
    {

get
{
return TheSingleGlobalVariableInstance;
}
}

private int result6;
public int Result6
{
get{ return result6; }
set {result6 = value; }
}
[/code]

and from your other code, you can call it like this

[code]
Console.WriteLine("This is the DMUServer : {0}", GlobalVariables.Instance.Result6);
[/code]

dickersonka 104

are you meaning all your double backslashes?

just run a replace on your escaped characters

[code]
Dim fileAsString As String = myString.Replace("\", "\")
[/code]

i think this is how with vb, more familiar with csharp

dickersonka 104

try this

its unclear why you are using string text as a parameter if its not being passed on, but here it is

[code]
void delegate textCallback(string text);
public void ThreadProcSafe2(String text)
{
if (this.m_AllKnownDevicesFrm.InvokeRequired)
{
this.m_AllKnownDevicesFrm.Invoke(new textCallback(ThreadProcSafe2), text);
}
else
{
switchPanels(1);
}
}
[/code]