post list
This commit is contained in:
parent
63330d5fc0
commit
f5349db697
14
DBchat.cs
14
DBchat.cs
@ -14,8 +14,9 @@ namespace NeDvachAPI
|
||||
public static Post[] DbList()
|
||||
{
|
||||
// Build connection string using parameters from portal
|
||||
Post[] posts = new Post[10];
|
||||
int postCount = 0;
|
||||
//Post[] posts = new Post[10];
|
||||
List<Post> posts = new List<Post>();
|
||||
//int postCount = 0;
|
||||
string received = "";
|
||||
string connString =
|
||||
String.Format(
|
||||
@ -37,8 +38,8 @@ namespace NeDvachAPI
|
||||
SELECT * FROM
|
||||
(SELECT post_id, substring(post,1,200)
|
||||
FROM dvach
|
||||
ORDER BY post_id
|
||||
DESC limit 10)
|
||||
ORDER BY post_id DESC
|
||||
)
|
||||
subquery ORDER BY post_id ASC", conn) )
|
||||
{
|
||||
|
||||
@ -58,8 +59,9 @@ namespace NeDvachAPI
|
||||
Id = reader.GetInt32(0),
|
||||
Text = reader.GetString(1)
|
||||
};
|
||||
posts[postCount] = receivedPost;
|
||||
postCount++;
|
||||
posts.Add(receivedPost);
|
||||
//posts[postCount] = receivedPost;
|
||||
//postCount++;
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user