G
Guest
i want some of the functions to be in dbsample.cs and call it from form1.cs,
and want to know which is the right way to do so. If i create [public string
SomeFuction()] it works but [public static OleDbDataAdapter DbStatusWrite(
OleDbConnection connection)]. this is doesn't work.
from dbsample.cs
namespace eSpace
{
class dbSample
{
public string GetDbValue()
{
return something..
}
public static OleDbDataAdapter DbStatusWrite(
OleDbConnection connection)
{
somecode
return somecode
}
}
}
from Form1.cs
namespace eSpace
{
public partial class Form1 : Form
{
private dbSample sm = new dbSample();
private void TestButton_Click(object sender, EventArgs e)
{
this works fine
sm.GetDbValue();
sm.DbStatusWrite() (the function is not seen from
intellisense )
}
}
}
and want to know which is the right way to do so. If i create [public string
SomeFuction()] it works but [public static OleDbDataAdapter DbStatusWrite(
OleDbConnection connection)]. this is doesn't work.
from dbsample.cs
namespace eSpace
{
class dbSample
{
public string GetDbValue()
{
return something..
}
public static OleDbDataAdapter DbStatusWrite(
OleDbConnection connection)
{
somecode
return somecode
}
}
}
from Form1.cs
namespace eSpace
{
public partial class Form1 : Form
{
private dbSample sm = new dbSample();
private void TestButton_Click(object sender, EventArgs e)
{
this works fine
sm.GetDbValue();
sm.DbStatusWrite() (the function is not seen from
intellisense )
}
}
}