I have a website that it is asp.net with c# language. I connect to Dynamics CRM with this code :
CrmServiceClient service = new CrmServiceClient("url=my url; Domain=my domain; username=user; password=pass");
and I retrieve all things from CRM to my website,and every thing work well, when I start my website from visual studio. but I have finished my website now, and I want to publish it in my IIS. but when it comes to the first codes that retrieve data from Dynamics CRM like this code :
QueryExpression query = new QueryExpression { EntityName = "account", ColumnSet = new ColumnSet("hi_password", "name", "hi_typeofaccount", "accountnumber") };
query.Criteria.AddCondition("hi_password", ConditionOperator.Equal,Txt_Password .Text );
query.Criteria.AddCondition("name", ConditionOperator.Equal, Txt_UserName .Text );
EntityCollection result1 = service.RetrieveMultiple(query);
an error occurs with this title:
Object reference not set to an instance of an object
I don't have any error when I start my website from visual studio.