I want to read database tables with Attributes.
I have Table in database and I have class same fields name.
I want to transfer to my class which matched values in database using attributes.
For Example :
[ReadDBAttributes]
public class News{
public string Title;
public string Content;
}
How can I do it?
Assuming MySQL you’ll need a table
Then you’ll insert your data using escaped values where noted.
INSERT INTO News (Title, Content) VALUES ('[ESCAPED TITLE]', '[ESCAPED CONTENT]')You can then read these back out in any number of ways (this assumes MySQL).