Thursday, January 6, 2011

Date in day Words -SQL_ Server

SELECT
CASE DATEPART(dw,getdate())
WHEN 2 THEN ‘MON’
WHEN 3 THEN ‘TUE’
WHEN 4 THEN ‘WED’
WHEN 5 THEN ‘THU’
WHEN 6 THEN ‘FRI’
WHEN 7 THEN ‘SAT’
WHEN 1 THEN ‘SUN’
ELSE ‘ALL’
END

http://blog.sqlauthority.com/2007/06/08/sql-server-udf-function-to-display-current-week-date-and-day-weekly-calendar/

Wednesday, January 5, 2011

Sql-server 2008 Import export data

on database right click ->Tasks->Import Data-> Follow the wizard...

Tuesday, January 4, 2011

Database size sql server using sql command

How to know database size using sql command
 
sp_spaceused

Thursday, December 30, 2010

Google Maps Control C# pin

http://www.c-sharpcorner.com/uploadfile/shabdarghata/google-maps-user-control-for-asp-net-part103232008234414pm/google-maps-user-control-for-asp-net-part1.aspx?login=true

Wednesday, December 29, 2010

Update,Delete in a table - SQL injection free C# .net

Update,Delete in a table - SQL injection free C# .net

  void updateADJ()
    {
        SqlConnection myConnection = new SqlConnection(ConnectionString);
        string strSQL;
        strSQL = "update BOINVADJ set IAMEDQTY1=@IAMEDQTY1,IAMEDQTY2=@IAMEDQTY2,"
        + " IABOXQTY=@IABOXQTY,IAGELQTY=@IAGELQTY,IACRYQTY=@IACRYQTY "
        + " WHERE IAID =" + Request["ID"];
        SqlCommand cmd = new SqlCommand(strSQL, myConnection);
        cmd.Parameters.AddWithValue("@IAMEDQTY1",TextBox2.Text  );
        cmd.Parameters.AddWithValue("@IAMEDQTY2", TextBox3.Text);
        cmd.Parameters.AddWithValue("@IABOXQTY", TextBox4.Text);
        cmd.Parameters.AddWithValue("@IAGELQTY", TextBox5.Text);
        cmd.Parameters.AddWithValue("@IACRYQTY", TextBox6.Text);

        myConnection.Open();
        cmd.ExecuteNonQuery();
        myConnection.Close();
    }
    void Deletedata()
    {
        SqlConnection myConnection = new SqlConnection(ConnectionString);
        string strSQL;
        strSQL = "delete from BOINVADJ WHERE IAID=" + Request["ID"];
        SqlCommand cmd = new SqlCommand(strSQL, myConnection);
        cmd.CommandType = CommandType.Text;
        myConnection.Open();
        cmd.ExecuteNonQuery();
        myConnection.Close();
        Response.Redirect("invadj.aspx");
    }

Monday, December 27, 2010

Change Row color in gridview C#

change Row color in gridview C#

public void gridViewMaster_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
    

    if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Type")).ToString().Trim() == "Media3")
            {
                e.Row.BackColor = Color.Yellow;
            }
    }

Sunday, December 26, 2010

AJAX Extender Control with Pop-up Window

Microsoft AJAX extender controls enhance the client capabilities of standard ASP.NET Web server controls. This example presents AJAX extender control "tbox" that interacts with the HTML DOM elements in a pop-up window. Extender control was developed in Visual Studio 2005.


http://www.codeproject.com/KB/webforms/AJAX-Extender-Control.aspx

Prepare web.config for HTML5 and CSS3

HTML5 and CSS3 introduces some new file types that enables us to create even better websites. We are now able to embed video, audio and custom fonts natively to any web page. Some of these file types are relatively new and not supported by the IIS web server by default. It’s file types like .m4v, .webm and .woff.

http://madskristensen.net/post/Prepare-webconfig-for-HTML5-and-CSS3.aspx


Monday, December 20, 2010

WCF Business Domain - Parent & Child Relationships

WCF by example is a series of articles that describe how to design and develop a WPF client using WCF for communication and NHibernate for persistence purposes. The series introduction describes the scope of the articles and discusses the architect solution at a high level. The source code for the series is found at CodePlex.

WCF by Example - Chapter XIII - Business Domain - Parent & Child Relationships - CodeProject
 
http://www.codeproject.com/KB/architecture/wcfbyexample_chapter13.aspx

Saturday, December 18, 2010

Creating a HTML5 video player control ,asp.net c#

This tutorial will introduce you to the process of ASP.NET server control development. You’ll also see how creating your own controls can simultaneously improve the quality of your Web applications, make you more productive and improve your user interfaces.

ASP.NET custom controls are more flexible than user controls. We can create a custom control that inherits from another server-side control and then extend that control. We can also share a custom control among projects. Typically, we will create our custom control in a web custom control library that is compiled separately from our web application. As a result, we can add that library to any project in order to use our custom control in that project.

ASP.NET 4.0 using Visual Studio 2010 deployment Package/Publish Web tool

There's many ASP.NET developers using Visual Studio who need flexible options and would like a UI to manage deployment tasks. These developers tend to deploy web applications themselves and a few deployment scenarios that exist today where you'll see those developers deploying applications themselves:

  • Small to mid-sized companies where the developer sees the application end to end, often a solo developer, however s/he might be on a small team.
  • Individual consultants or small consultancies that need to deploy remotely, often using FTP or FTPS (secure FTP).
  • Small to mid-sized teams that don't have automated deployment or CI in place and are in charge of their own application deployments.

The central theme is that all three types of teams are all responsible for their own application deployments. If you work in a dev shop similar to one of these, you'll find Visual Studio 2010's Web Deploy feature is quite handy and should meet most of your deployment needs out of the box. But it's also easily extensible to get those few unique deployment tasks you may have configured and ready to go.

http://rachelappel.com/deployment/making-asp-net-deployment-easy-with-the-package-publish-web-tool/