generic object referance

M

Matt

How can make line 3 generic so i dont have to call it every function.
Would something like dataaccess works?
public class Validation

1 public bool IsAlpha(string str)
2 {
3 Regex alpha = new Regex(AlphaPattern);
4 alpha.whatever
5 }
**********************
public class DataAccess
{
private SqlConnection Conn;
public DataAccess() // Constructor
{
objConn = new SqlConnection();
}
private void OpenConnection()
{
objConn.ConnectionString = str";
objConn.Open();
}
public SqlDataReader DataRead(string strSQL)function
{
OpenConnection();
}
******************
public class Seren
{

private Regex Reg;

public RegEx RegF(strPatern)
{
Reg = new Regex(StrPattern);
}
public IsAlpha(string str)
{
RegF
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top