Hi Shmar
If the case is that you have an asp.net web project and want to insert data in CRM you need these steps:
1. Have a class to get the connection object (this connection is for a CRMOnline)
public IOrganizationService CRMCon()
{
String connectionString = "Url=instancename.crm.dynamics.com; Username=user@instancename.onmicrosoft.com; Password=passxx; authtype=Office365";
CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);
return (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
}
*But you can find the different connections string for the onpremise here: http://ninjadeveloper.com/how-to-connect-to-dynamics-crm-2016-online-and-on-premise-using-a-c-console-application/
1.1 Once you get the object CRMCon you pass it to the next method
2. In the server side of your app you can have different options using the SDK to insert/retrieve or delete info here's one example to insert records
public Guid CreateLead(IOrganizationService service)
{
Entity lead = new Entity("lead");
lead.Attributes.Add("subject", "Lead from .NET");
lead.Attributes.Add("lastname", "Macias");
lead.Attributes.Add("firstname", "Sergio");
lead.Attributes.Add("telephone1", "81542531");
lead.Attributes.Add("companyname", "My Company");
lead.Attributes.Add("websiteurl", "www.mycompany.com");
Decimal revenue = 12250;
lead.Attributes.Add("revenue", new Money(revenue));
Guid MyResultGuid = service.Create(lead);
return MyResultGuid;
 
}
In this step you can see that I´m using the late bound, in this case you need to know the schema name for your fields, here you need to remember that all names are lower case.
Hope this helps you.