Following this link I have found GP table "SY01200" with fields matching those I need ("EmailToAddress", "Master_ID"). Sadly, there are no email addresses for debtors. Could you tell me what I am doing wrong, please? Is information about "SY01200" correct? I am convinced that there is nothing wrong with the code:
static void Main(string[] args)
{
SqlConnectionStringBuilder b = new SqlConnectionStringBuilder();
SqlConnection c = new SqlConnection("data source=localhost;initial catalog=TWO;integrated security=SSPI;persist security info=False;packet size=4096;");
c.Open();
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = c;
myCommand.CommandType = CommandType.Text;
myCommand.CommandText = "select * from SY01200 ";
SqlDataReader myDataReader = myCommand.ExecuteReader();
Console.WriteLine("F:" + myDataReader.FieldCount);
while (myDataReader.Read())
{
Console.WriteLine("code: " + myDataReader["ADRSCODE"]);
Console.WriteLine("master: " + myDataReader["Master_ID"]);
Console.WriteLine("TO: "+ myDataReader["EmailToAddress"]);
}
Console.ReadKey();
}
Is there? I am getting empty strings from "Master_ID" and "EmailToAddress" and some data from "ADRSCODE", but nothing useful.
Thanks in advance for any direction.