<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rothline Entertainment &#187; asp.net</title>
	<atom:link href="http://www.rothline.com/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rothline.com</link>
	<description>By Lawrence Roth: A fan of books, computers, movies, and anything else that keeps me entertained.</description>
	<lastBuildDate>Sat, 15 May 2010 18:05:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Login.aspx.cs Connecting to SQL Server with ASP.NET</title>
		<link>http://www.rothline.com/2009/07/login-aspx-cs-connecting-to-sql-server-with-asp-net/</link>
		<comments>http://www.rothline.com/2009/07/login-aspx-cs-connecting-to-sql-server-with-asp-net/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 18:35:06 +0000</pubDate>
		<dc:creator>Lawrence Roth</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[ado.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[connection string]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://blog.rothline.com/?p=157</guid>
		<description><![CDATA[using System; using System.Configuration; using System.Data.SqlClient; public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void LoginButton_Click(object sender, EventArgs e) { String cs = ConfigurationManager.ConnectionStrings["csString"].ConnectionString; String strUserName = UserName.Text; String strPassword = Password.Text; String strUserId = &#8220;&#8221;; String strMemberId = &#8220;&#8221;; String strRoleId = &#8220;&#8221;; DateTime dtLogDate = [...]]]></description>
			<content:encoded><![CDATA[<p>using System;<br />
using System.Configuration;<br />
using System.Data.SqlClient;</p>
<p>public partial class Login : System.Web.UI.Page<br />
{<br />
    protected void Page_Load(object sender, EventArgs e)<br />
    {</p>
<p>    }<br />
    protected void LoginButton_Click(object sender, EventArgs e)<br />
    {<br />
        String cs = ConfigurationManager.ConnectionStrings["csString"].ConnectionString;</p>
<p>        String strUserName = UserName.Text;<br />
        String strPassword = Password.Text;<br />
        String strUserId = &#8220;&#8221;;<br />
        String strMemberId = &#8220;&#8221;;<br />
        String strRoleId = &#8220;&#8221;;</p>
<p>        DateTime dtLogDate = DateTime.Now;</p>
<p>        String strQuery = &#8220;SELECT &#8221; +<br />
                   &#8220;user_id, &#8221; +<br />
                   &#8220;member_id, &#8221; +<br />
                   &#8220;role_id &#8221; +<br />
                   &#8220;FROM &#8221; +<br />
                   &#8220;application_users &#8221; +<br />
                   &#8220;WHERE &#8221; +<br />
                   &#8220;username = &#8216;&#8221; + strUserName + &#8220;&#8216; &#8221; +<br />
                   &#8220;AND &#8221; +<br />
                   &#8220;password = &#8216;&#8221; + strPassword + &#8220;&#8216;&#8221;;</p>
<p>        SqlConnection cn = new SqlConnection(cs);</p>
<p>        SqlCommand cmd = new SqlCommand(strQuery, cn);<br />
        cn.Open();</p>
<p>        SqlDataReader dr = cmd.ExecuteReader();</p>
<p>        if (!dr.HasRows)<br />
        {<br />
            Response.Redirect(&#8220;Failure.aspx&#8221;);<br />
        }</p>
<p>        while (dr.Read())<br />
        {<br />
            strUserId = dr["user_id"].ToString();<br />
            strMemberId = dr["member_id"].ToString();<br />
            strRoleId = dr["role_id"].ToString();<br />
        }<br />
        Session["snLog"] = dr;</p>
<p>        String strSession = Session.SessionID.ToString();</p>
<p>        cn.Close();<br />
        String strInsert = &#8220;INSERT INTO &#8221; +<br />
                           &#8220;application_logs &#8221; +<br />
                           &#8220;(user_id, &#8221; +<br />
                           &#8220;log_datetime, &#8221; +<br />
                           &#8220;log_session) &#8221; +<br />
                           &#8220;VALUES (&#8221; +<br />
                           @strUserId + &#8220;, &#8216;&#8221; +<br />
                           @dtLogDate + &#8220;&#8216;, &#8221; +<br />
                           &#8220;&#8216;&#8221; + @strSession + &#8220;&#8216;)&#8221;;</p>
<p>        SqlConnection cnInsert = new SqlConnection(cs);<br />
        SqlCommand cmdInsert = new SqlCommand(strInsert, cnInsert);</p>
<p>        //Add SqlParameters to the SqlCommand<br />
        cmdInsert.Parameters.AddWithValue(&#8220;@strUserId&#8221;, strUserId);<br />
        cmdInsert.Parameters.AddWithValue(&#8220;@dtLogDate&#8221;, dtLogDate);<br />
        cmdInsert.Parameters.AddWithValue(&#8220;@strSession&#8221;, strSession);</p>
<p>        cnInsert.Open();<br />
        cmdInsert.ExecuteNonQuery();<br />
        cnInsert.Close();</p>
<p>        Response.Redirect(&#8220;Success.aspx&#8221;);<br />
    }<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rothline.com/2009/07/login-aspx-cs-connecting-to-sql-server-with-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ADO.NET 3.5 Web.Config Connection String to SQL Server</title>
		<link>http://www.rothline.com/2009/07/ado-net-3-5-web-config-connection-string-to-sql-server/</link>
		<comments>http://www.rothline.com/2009/07/ado-net-3-5-web-config-connection-string-to-sql-server/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 18:14:06 +0000</pubDate>
		<dc:creator>Lawrence Roth</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[ado.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[connection string]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://blog.rothline.com/2009/07/ado-net-3-5-web-config-connection-string-to-sql-server/</guid>
		<description><![CDATA[providerName=&#8221;System.Data.SqlClient&#8221; connectionString=&#8221;Data Source=XX\WS5; Initial Catalog=XX_Catalog;Integrated Security=True&#8221; /&#62;]]></description>
			<content:encoded><![CDATA[<p>providerName=&#8221;System.Data.SqlClient&#8221;<br />
connectionString=&#8221;Data Source=XX\WS5; Initial Catalog=XX_Catalog;Integrated Security=True&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rothline.com/2009/07/ado-net-3-5-web-config-connection-string-to-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
