Assembly 'ABC, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' contains a Web resource with name 'PasswordExtenderBehavior.js',
but does not contain an embedded resource with name 'PasswordExtenderBehavior.js'.
for this we need to select "PasswordExtenderBehavior.js" right click and go to properties select BUILD Action-> Embedded Resource This blog aims to provide some technical tips about Microsoft Dynamics CRM 4.0 to D365, SQL Server and .Net.
Friday, September 13, 2013
Friday, September 6, 2013
Open MS CRM Form in Classic Mode always
Add the below code in Ribbon button. Whenever you click on that button the form will open in Classic Mode
function openClassicForm() {
var name =Xrm.Page.data.entity.getEntityName();
var id =Xrm.Page.data.entity.getId();
var clientUrl = Xrm.Page.context.getClientUrl();
var url = clientUrl + "/main.aspx?etn=" + name + "&extraqs=%3fid%3d" + id + "%26&pagetype=entityrecord&rof=true";
parent.parent.window.open(url);
}
function openClassicForm() {
var name =Xrm.Page.data.entity.getEntityName();
var id =Xrm.Page.data.entity.getId();
var clientUrl = Xrm.Page.context.getClientUrl();
var url = clientUrl + "/main.aspx?etn=" + name + "&extraqs=%3fid%3d" + id + "%26&pagetype=entityrecord&rof=true";
parent.parent.window.open(url);
}
Monday, September 2, 2013
Check the Username and Password from Active Directory
using System.DirectoryServices.Protocols;[Add this reference]
namespace Usernamepassword
{
class Program
{
static void Main(string[] args)
{
try
{
LdapConnection connection = new LdapConnection("domain.com");
//Ex:Gmail.com
NetworkCredential credential = new NetworkCredential("username", "Password");
connection.Credential = credential;
connection.Bind();
Console.WriteLine("Succesfully Logged In");
Console.ReadKey();
}
catch (LdapException msg)
{
String error = msg.ServerErrorMessage;
Console.WriteLine(msg);
Console.ReadKey();
}
catch (Exception exc)
{
Console.WriteLine(exc);
Console.ReadKey();
}
}
}
}
namespace Usernamepassword
{
class Program
{
static void Main(string[] args)
{
try
{
LdapConnection connection = new LdapConnection("domain.com");
//Ex:Gmail.com
NetworkCredential credential = new NetworkCredential("username", "Password");
connection.Credential = credential;
connection.Bind();
Console.WriteLine("Succesfully Logged In");
Console.ReadKey();
}
catch (LdapException msg)
{
String error = msg.ServerErrorMessage;
Console.WriteLine(msg);
Console.ReadKey();
}
catch (Exception exc)
{
Console.WriteLine(exc);
Console.ReadKey();
}
}
}
}
Wednesday, August 28, 2013
Convert .mdb to SQL database
There's also the SQL Server Import and Export Wizard
- Open SSMS.
- Create a new empty database.
- Right-click the database in the Object Explorer.
- Select Tasks | Import Data... from the context menu.
- Change the data source to Microsoft Access.
- Browse for the file name.
- Click Next...
- That's it :-)
Tuesday, August 27, 2013
Create a Trigger
Create a trigger that will insert the old and new Passwords into a Table.
Open SSMS--Select database[Master]-->Select tablename[Logins]-->Expand the table--> you can find the Triggers-->select that and right click to create New Trigger--> change the trigger as we need
In this example below am showing how can we store/insert the Password into Audit table[Old/New].
Audit is the new table with columns[OldPassword,NewPassword,DateTime].
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,K.Sai Krishna Yadav>
-- =============================================
CREATE TRIGGER AuditInfo
ON Login
AFTER INSERT,DELETE,UPDATE
AS
BEGIN
declare @OldValue Varchar(50)
declare @NewValue Varchar(50)
select @OldValue=password from deleted
select @NewValue=password from inserted
Insert into Audit(AuditInfo,OldValue,NewValue) values (GETDATE(),@OldValue,@NewValue)
SET NOCOUNT ON;
-- Insert statements for trigger here
END
GO
The above Trigger will fire when an INSERT,DELETE,UPDATE happens on Logins Table.
Open SSMS--Select database[Master]-->Select tablename[Logins]-->Expand the table--> you can find the Triggers-->select that and right click to create New Trigger--> change the trigger as we need
In this example below am showing how can we store/insert the Password into Audit table[Old/New].
Audit is the new table with columns[OldPassword,NewPassword,DateTime].
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,K.Sai Krishna Yadav>
-- =============================================
CREATE TRIGGER AuditInfo
ON Login
AFTER INSERT,DELETE,UPDATE
AS
BEGIN
declare @OldValue Varchar(50)
declare @NewValue Varchar(50)
select @OldValue=password from deleted
select @NewValue=password from inserted
Insert into Audit(AuditInfo,OldValue,NewValue) values (GETDATE(),@OldValue,@NewValue)
SET NOCOUNT ON;
-- Insert statements for trigger here
END
GO
The above Trigger will fire when an INSERT,DELETE,UPDATE happens on Logins Table.
Friday, August 9, 2013
Query to update multiple rows with particular data/string in SQL
update tablename set columnname=REPLACE(tablename.columnname,'string to search','string to replace')
Consider the below table with name 'Employee'
After executing the update statement
Consider the below table with name 'Employee'
ID | Name |
1 | sa |
2 | sa krishna |
3 | sa kumar |
4 | sa ganesh |
After executing the update statement
update Employee set Name=REPLACE(Employee.Name,'sa','sai')
then the final result will be
then the final result will be
ID | Name |
1 | sai |
2 | sai krishna |
3 | sai kumar |
4 | sai ganesh |
Monday, July 22, 2013
Send Email to multiple receipts individually.
SmtpClient smtpclient = new SmtpClient();
System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage();
MailAddress mailAddress = new MailAddress("EMailID", "Admin",
System.Text.Encoding.UTF8);
mailMsg.From = mailAddress;
if (dtemail.Rows.Count > 0)
{
StringBuilder br = new StringBuilder();
for (int i = 0; i < dtemail.Rows.Count; i++)
{
string strTO = dtemail.Rows[i][0].ToString();
br.Append(dtemail.Rows[i][0].ToString()+";");
}
mailMsg.IsBodyHtml = true;
mailMsg.Subject = Session["Subject"].ToString();
mailMsg.Body = "<html><body><table><tr><td>" + Session["DecodeOriginal"] + "</td></tr></table></body></html>";
smtpclient.Credentials = new System.Net.NetworkCredential("EMailID", "password");
smtpclient.Host = "smtp.gmail.com";
smtpclient.Port = 25;
smtpclient.EnableSsl = true;
string strtoaddress = br.ToString();
string[] Addresses = strtoaddress.Split(';');
foreach (string address in Addresses)
{
if (address != "")
{
mailMsg.To.Add(new System.Net.Mail.MailAddress(address));
smtpclient.Send(mailMsg);
mailMsg.To.Clear();
}
}
Response.Write(@"<script language='javascript'>alert('Your Email has been sent successfully - Thank You.');</script>");
btnSendMail.Visible = false;
}
else
{
Response.Write(@"<script language='javascript'>alert('Please select Email-ID.');</script>");
}
System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage();
MailAddress mailAddress = new MailAddress("EMailID", "Admin",
System.Text.Encoding.UTF8);
mailMsg.From = mailAddress;
if (dtemail.Rows.Count > 0)
{
StringBuilder br = new StringBuilder();
for (int i = 0; i < dtemail.Rows.Count; i++)
{
string strTO = dtemail.Rows[i][0].ToString();
br.Append(dtemail.Rows[i][0].ToString()+";");
}
mailMsg.IsBodyHtml = true;
mailMsg.Subject = Session["Subject"].ToString();
mailMsg.Body = "<html><body><table><tr><td>" + Session["DecodeOriginal"] + "</td></tr></table></body></html>";
smtpclient.Credentials = new System.Net.NetworkCredential("EMailID", "password");
smtpclient.Host = "smtp.gmail.com";
smtpclient.Port = 25;
smtpclient.EnableSsl = true;
string strtoaddress = br.ToString();
string[] Addresses = strtoaddress.Split(';');
foreach (string address in Addresses)
{
if (address != "")
{
mailMsg.To.Add(new System.Net.Mail.MailAddress(address));
smtpclient.Send(mailMsg);
mailMsg.To.Clear();
}
}
Response.Write(@"<script language='javascript'>alert('Your Email has been sent successfully - Thank You.');</script>");
btnSendMail.Visible = false;
}
else
{
Response.Write(@"<script language='javascript'>alert('Please select Email-ID.');</script>");
}
Subscribe to:
Posts (Atom)