Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forumguidelines
Ram Prasad
1.7k
293
5.9k
Comparing output of program with the sqlite database
Jan 27 2021 6:06 AM
I am comparing dataVal output with the sqlite database as shown in the code below.
For Example: Lets assume output of dataVal is Kelly. When I run the program, in the first loop string z stores value "K" and then store "Kelly" only after second loop. Can someone please elaborate what is happening here and how to get the value of z as 'Kelly' after first loop?
dataVal = string.Join("", dataResult.ToArray());
Aryabase databaseObject = new Aryabase();
if (dataVal.StartsWith('k'))
{
using (SQLiteConnection con = new SQLiteConnection(databaseObject.myConnection))
{
SQLiteCommand cmd = new SQLiteCommand("select * from k where Data like 'k%'", con);
con.Open();
var rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string z = Convert.ToString(rdr["Data"]);
if (dataVal == z)
{
Console.WriteLine(Convert.ToString(rdr["Data"]));
}
}
}
}
Reply
Answers (
1
)
Regarding lists
print current record in crystal report without print preview