front end: Visual Basic C# 2019;
back end: SQL Server 2017;
I am rather new to C# and could use some help. I am reading a SQL table using a SQL data reader. Here is the code
I am getting a compile error that states:
CS0149 Method name expected at this statement
I cannot figure out why. Can someone help?
Thanks.
back end: SQL Server 2017;
I am rather new to C# and could use some help. I am reading a SQL table using a SQL data reader. Here is the code
Code:
string strSQL = "select * from proddta.f4311 where pdan8='" + supplierNo + "' AND PDDRQJ>='" + jdeStart + "' AND PDDRQJ<='" + jdeEnd + "' order by pddrqj";
SqlConnection con = new SqlConnection(SR_SupplierRatings.SQLTables.csJDE);
con.Open();
SqlCommand cmd = new SqlCommand(strSQL, con);
SqlDataReader dr = cmd.ExecuteReader();
int myCount = 0;
try
{
while (dr.Read())
{
if (dr("PDMCU") != 372)
{
myCount += 1;
}
}
con.Close();
CS0149 Method name expected at this statement
Code:
if (dr("PDMCU") != 372)
Thanks.
Comment