I need your help to resolve this issue.
How to pass table name dynamically in linq to sql in C#.net?
public IntPol(DataClasses1DataContext DC, decimal value,string tableName)
{
}
tableName will change dynamically.
I need your help to resolve this issue.
How to pass table name dynamically in linq to sql in C#.net?
public IntPol(DataClasses1DataContext DC, decimal value,string tableName)
{
}
tableName will change dynamically.
If I understand the question correctly then you could do something like
public IntPol(DataClasses1DataContext DC, decimal value,string tableName)
{
DC = new DataClasses1DataContext("yourConnString");
var result = DC.Mapping.GetTables().SingleOrDefault(t => t.TableName.ToString() == tableName);
}
Or you could also do tableObject.GetType().Name but if type is dynamic might have to send Type tableType separately.