Declare it as
member of the form class (instead of local of the formLoad method).
If you are using it in the form class itself then you don't need to declare it as
public
.
public partial class MyForm : Form
{
string datacompany;
private void MyForm_Load(object sender, EventArgs e)
{
datacompany = rm.GetString("datacompany");