I'm trying to make a function to carry out SQL queries in my own libray but I can't figure out how to return the query result. Declaring the function "public static DataTable MyQuery(string sql) gives the error "public not valid". So I have to figure out how to get the data back to the caller in some other form that they can use. This could be a single value or multiple values in multiple rows so I am at a complete loss in how to proceed. Anyone have any ideas other than doing queries separately in several different forms?