I’m trying to write a web-service method that takes two parameters
public <ReturnType> GetDictionary(string ID, string TableName)
and return a row from the table.
In code I’m trying somthing like this:
oraConnection.Open();
string sql = "select * from :TableName where id = :ID ";
OracleCommand oraComand = new OracleCommand(sql,oraConnection);
OracleDataReader oraReader = oraComand.ExecuteReader();
Could someone help me find the right approach to this task?
I would not pass the DataRow down to the client, if really had to be like you describe, once you identify the DataRow to return you can return its ItemArray.
or even better, you create a business entity which contains all the fields you need and in the code above you initialize an instance of it from the content of your DataReader.
P.S. currently your code is not even getting a DataRow but a DataReader…