Unable to make connection to database?http://forums.asp.net/t/1590757.aspx/1?Unable+to+make+connection+to+database+Mon, 23 Aug 2010 15:03:48 -040015907574029271http://forums.asp.net/p/1590757/4029271.aspx/1?Unable+to+make+connection+to+database+Unable to make connection to database? <p>Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.</p> <p>I have database called PhoneDirectory.</p> <p>It have only one table named Residents.</p> <p>I have button wiht ID=&quot;Button1&quot;.</p> <p>I want when i click this button to see all of my residents.&nbsp;</p> <p>I want to see the result in DetailsView and to be able to edin, delete and add new resident.</p> <p>First try with SqlDataSource so i wrote this:</p> <p><br> </p> <p></p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum')&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;SelectParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:ControlParameter ControlID=&quot;Resident Details&quot; Name=&quot;ProductID&quot; PropertyName=&quot;SelectedValue&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/SelectParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;&lt;/div&gt; <p></p> <p><i><b>&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;</b></i></p> <p><i><b><br> </b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</b></i></p> <p><i><b><br> </b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum&quot; &#43;&nbsp;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum')&quot; &#43;&nbsp;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</b></i></p> <p><i><b><br> </b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;</b></i></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;</b></i></p> <p></p> <p><br> </p> <p>For the DetailsView - &gt;</p> <p><i><b>&lt;asp:DetailsView ID=&quot;Resident Details&quot; runat=&quot;server&quot; Height=&quot;50px&quot; Width=&quot;125px&quot; DataSourceID=&quot;Resident Details&quot;&gt;</b></i></p> <p></p> <p><i><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:DetailsView&gt;</b></i></p> <p></p> <p><br> </p> <p>And now i don't know how to bind all these 3 things. Please help.</p> <p><br> </p> <p>P.S. I guess i miss something in SqlDataSource like Parameters but i'm not sure what to add. </p> <p>I use <i>Beginning ASP.NET 3.5 in C# 2008 From Novice to Professional, Second Edition</i> for this.&nbsp;</p> <p></p> <p><br> </p> <p><br> </p> 2010-08-16T09:24:04-04:004029434http://forums.asp.net/p/1590757/4029434.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Veschich</h4> And now i don't know how to bind all these 3 things.</blockquote> <p></p> <p>Start looking at: <a href="http://www.asp.net/web-forms/data">http://www.asp.net/web-forms/data</a><br> </p> <p><br> </p> 2010-08-16T10:52:42-04:004029613http://forums.asp.net/p/1590757/4029613.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Well there's a lot of info but where to begin? I mean a wrote a code and i think it has to be filled with something not to write it again right?</p> 2010-08-16T12:01:53-04:004029670http://forums.asp.net/p/1590757/4029670.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Veschich</h4> Well there's a lot of info but where to begin? </blockquote> <p></p> <p>Since you are using SqlDataSource then you can start by following this example:<a href="http://www.asp.net/data-access/tutorials/inserting-updating-and-deleting-data-with-the-sqldatasource-cs"> http://www.asp.net/data-access/tutorials/inserting-updating-and-deleting-data-with-the-sqldatasource-cs</a><br> </p> <p><br> </p> 2010-08-16T12:25:26-04:004030171http://forums.asp.net/p/1590757/4030171.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Ok. I'v read again a lot of information, repair my code but still need help. This is my code:</p> <p><br> </p> <p></p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum')&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;UpdateParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/UpdateParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;InsertParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/InsertParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DeleteParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;int&quot; /&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/DeleteParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; DataSourceID=&quot;Resident Details&quot; AutoGenerateColumns=&quot;True&quot; PageSize=&quot;10&quot; AllowPaging=&quot;True&quot; style=&quot;font-family: Verdana&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Columns&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;FNAME&quot; HeaderText=&quot;First Name&quot; &nbsp;SortExpression=&quot;FNAME&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;LNAME&quot; HeaderText=&quot;Last Name&quot; &nbsp;SortExpression=&quot;LNAME&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;MobileNum&quot; HeaderText=&quot;Mobile Number&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;HomeNum&quot; HeaderText=&quot;Home Number&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;OfficeNum&quot; HeaderText=&quot;Office Number&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;FaxNum&quot; HeaderText=&quot;Fax Number&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowEditButton=&quot;True&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowDeleteButton=&quot;True&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowInsertButton=&quot;True&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Columns&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:GridView&gt;&lt;/div&gt; <p></p> <p>&nbsp;<i>&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum&quot; &#43;&nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum')&quot; &#43;&nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum&quot; &#43;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;UpdateParameters&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/UpdateParameters&gt;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;InsertParameters&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/InsertParameters&gt;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DeleteParameters&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;int&quot; /&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/DeleteParameters&gt;</i></p> <p><i><br> </i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;br /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; DataSourceID=&quot;Resident Details&quot; AutoGenerateColumns=&quot;True&quot; PageSize=&quot;10&quot; AllowPaging=&quot;True&quot; style=&quot;font-family: Verdana&quot;&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Columns&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;FNAME&quot; HeaderText=&quot;First Name&quot; &nbsp;SortExpression=&quot;FNAME&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;LNAME&quot; HeaderText=&quot;Last Name&quot; &nbsp;SortExpression=&quot;LNAME&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;MobileNum&quot; HeaderText=&quot;Mobile Number&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;HomeNum&quot; HeaderText=&quot;Home Number&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;OfficeNum&quot; HeaderText=&quot;Office Number&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:BoundField DataField=&quot;FaxNum&quot; HeaderText=&quot;Fax Number&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowEditButton=&quot;True&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowDeleteButton=&quot;True&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:CommandField ShowInsertButton=&quot;True&quot; /&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Columns&gt;</i></p> <p><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:GridView&gt;</i></p> <p><br> </p> <p>And here's the errors it gain:</p> <p></p> <p><br> </p> <p>Build (web): The server tag is not well formed. - this line ---&gt;&gt;&gt;&nbsp;<i>&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;</i></p> <p><i><span class="Apple-style-span" style="font-style:normal">and:</span></i></p> <p><i>Literal expressions like '&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;' are not allowed. Use &lt;asp:Literal runat=&quot;server&quot; Text=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot; /&gt; instead.</i></p> <p>at this line ---&gt;&gt;&gt;&nbsp;&nbsp;<i>&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;</i></p> <p><br> </p> <p>Any guesses???</p> <p></p> 2010-08-16T17:13:00-04:004030195http://forums.asp.net/p/1590757/4030195.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>You may not concatenate the strings in UpdateCommand, InsertCommand and DeleteCommand properties in this way. The right syntax is</p> <pre class="prettyprint">UpdateCommand = &quot;UPDATE Resident SET ..., MobileNum=@MobileNum, HomeNum=@HomeNum, ... FaxNum=@original_FaxNum&quot;</pre> <p>(no ...&quot;&#43;&quot;...&quot;&#43;&quot;...)</p> <p>Hope this helps.</p> <p><br> </p> 2010-08-16T17:34:23-04:004030238http://forums.asp.net/p/1590757/4030238.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Why are you using &quot;&#43;&quot; to&nbsp;concatenate&nbsp;the rows. </p> <p>Do not use &quot;&#43;&quot;. </p> <p>Do it like this:</p> <p style="font-size:11px"><i>UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,</i></p> <p style="font-size:11px"><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&nbsp;</i></p> <p style="font-size:11px"><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum</i></p> <p style="font-size:11px"><i>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</i></p> <p style="font-size:11px"><br> </p> <p style="font-size:11px">&quot;UpdateCommand&quot; tag color will become red and the rest will become blue color.</p> <p style="font-size:11px">Hope this will help you.</p> 2010-08-16T18:07:07-04:004030241http://forums.asp.net/p/1590757/4030241.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>as far as i understand this is for better viewing because i think:</p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,&quot; &#43;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &#43;&nbsp;&lt;/div&gt; <p></p> <p></p> <p><i>&quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME,&nbsp;OfficeNum=@OfficeNum&quot; &#43; &nbsp;</i></p> <p><i>&quot;FaxNum=@FaxNum&quot;&nbsp;</i></p> <p></p> <p>in two lines is equal as:</p> <p></p> <p><i>&quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, &quot;</i><i>&nbsp;&nbsp;OfficeNum=@OfficeNum, FaxNum=@FaxNum&quot; &nbsp;</i></p> <p>in only one.</p> <p>I think the problem is somewhere else. Plus that for now i don't connect Button1 with the SqlDataSource so may be here's the problem?</p> <p></p> <p><br> </p> <p></p> <p></p> 2010-08-16T18:09:29-04:004030490http://forums.asp.net/p/1590757/4030490.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Veschich</h4> <p></p> <p>I think the problem is somewhere else.&nbsp;</p> <p></p> </blockquote> <p></p> <p>It's not true. The syntax with ...&quot;&#43;&quot;..&quot;&#43;&quot;... is wrong. It's a Visual Basic thing which is not accepted in the tag writing. Please remove end quotes and plus signs at the end of each line and quotes at the beginning of each line and see what happens.</p> <p></p> 2010-08-16T22:32:39-04:004032418http://forums.asp.net/p/1590757/4032418.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>You are right. I fix this but now this happen:</p> <p><br> </p> <p><i><span class="Apple-style-span" style="font-weight:bold">&nbsp;Build (web): Type 'System.Web.UI.WebControls.SqlDataSource' does not have a public property named 'ConnectionStrings'</span></i></p> <p><br> </p> <p><b><i><span class="Apple-style-span" style="font-weight:normal">At this line</span>&nbsp;---&gt;&gt;&gt;&nbsp;<span class="Apple-style-span" style="font-style:normal">&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;</span></i></b>&quot;&nbsp;</p> &lt;div&gt;<br> &lt;/div&gt; <p><br> </p> <p><br> </p> <p><br> </p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum, HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum') WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum, HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;UpdateParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/UpdateParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;InsertParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/InsertParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DeleteParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;int&quot; /&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/DeleteParameters&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;br /&gt;&lt;/div&gt; <p></p> <p>&lt;asp:SqlDataSource ID=&quot;Resident Details&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.SqlClient&quot; ConnectionStrings=&quot;&lt;%&#36; ConnectionStrings:ThisIsTheConnection%&gt;&quot;&nbsp;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectCommand = &quot;SELECT * FROM Resident &quot;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateCommand = &quot;UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum, HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertCommand = &quot;INSERT INTO Resident FNAME, LNAME, MobileNum, HomeNum, OfficeNum, FaxNum VALUES ( '@FNAME', '@LNAME', '@MobileNum', '@HomeNum', '@OfficeNum', '@FaxNum') WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteCommand = &quot;DELETE Resident WHERE FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum, HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME AND LNAME=@original_LNAME AND MobileNum=@original_MobileNum HomeNum=@original_HomeNum AND OfficeNum=@original_OfficeNum AND FaxNum=@original_FaxNum&quot; &gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;UpdateParameters&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/UpdateParameters&gt;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;InsertParameters&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;String&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;LNAME&quot; Type=&quot;String&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;MobileNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;HomeNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;OfficeNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FaxNum&quot; Type=&quot;Int&quot; /&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/InsertParameters&gt;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DeleteParameters&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Parameter Name=&quot;FNAME&quot; Type=&quot;int&quot; /&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/DeleteParameters&gt;</p> <p><br> </p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/asp:SqlDataSource&gt;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;br /&gt;</p> <p></p> <p><br> </p> <p><i><span class="Apple-style-span" style="font-weight:bold">And i have this in web.config:</span></i></p> <p><br> </p> <p></p> <p>&nbsp;&nbsp; &nbsp;&lt;add name=&quot;ThisIsMyConnection&quot;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; connectionString=&quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true&quot;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; providerName=&quot;System.Data.SqlClient&quot; /&gt;</p> <p>&nbsp;&nbsp;&lt;/connectionStrings&gt;</p> <p></p> <p><br> </p> <p>????</p> <p><br> </p> 2010-08-17T20:15:52-04:004032573http://forums.asp.net/p/1590757/4032573.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Great, at least one problem less.</p> <p>I guess it's a typo, the property must be named as <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.connectionstring.aspx"> ConnectionString</a>&nbsp;(no -s at the end).</p> 2010-08-17T22:06:12-04:004033019http://forums.asp.net/p/1590757/4033019.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Well. Yeah &quot;s&quot; was the problem and Int -&gt;Int32. Now i want to know how to bind Button1 with SqlDataSource. When i click the button to open the GridView(and before that to &nbsp;be hidden of course) and to execute my written query?</p> 2010-08-18T05:58:28-04:004033153http://forums.asp.net/p/1590757/4033153.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>&lt;asp:Button OnClick=&quot;Button_Click&quot; ...</p> <p>then put at the top of the page&nbsp;</p> <p>&lt;%@ Page Language=&quot;vb&quot; %&gt;</p> <p>...</p> <p>&lt;script language=&quot;VB&quot; runat=&quot;server&quot;&gt;</p> <p>Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br> GridViewID_HERE.Visible = True<br> End Sub</p> <p>&lt;/script&gt;</p> 2010-08-18T07:19:38-04:004033213http://forums.asp.net/p/1590757/4033213.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>smirnov</h4> <p></p> <p>&lt;asp:Button OnClick=&quot;Button_Click&quot; ...</p> <p>then put at the top of the page&nbsp;</p> <p>&lt;%@ Page Language=&quot;vb&quot; %&gt;</p> <p>...</p> <p>&lt;script language=&quot;VB&quot; runat=&quot;server&quot;&gt;</p> <p>Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br> GridViewID_HERE.Visible = True<br> End Sub</p> <p>&lt;/script&gt;</p> <p></p> </blockquote> <p></p> <p><br> </p> <p>I'm writing in C#?</p> <p>Is this code going to work?</p> <p></p> 2010-08-18T07:43:24-04:004033229http://forums.asp.net/p/1590757/4033229.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p></p> <pre class="prettyprint">&lt;script runat=&quot;server&quot;&gt; protected void Button_Click(object sender, EventArgs e) { GridViewID_HERE.Visible = true; } &lt;/script&gt;</pre> <p></p> 2010-08-18T07:54:48-04:004033337http://forums.asp.net/p/1590757/4033337.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Another problem come up:</p> <p><br> </p> <h2 style="font-family:Verdana; font-weight:normal; font-size:14pt; color:maroon"> <i>An attempt to attach an auto-named database for file D:\WebSites\PhoneDirectory\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.</i></h2> <p><br> </p> <p>Here i want to say that my database is not in the same directory as the web site:</p> <p>1. Is it have to be?</p> <p>2. Why try to open&nbsp;<span class="Apple-style-span" style="font-family:Verdana; font-size:19px; color:rgb(128,0,0)">aspnetdb.mdf ?</span></p> 2010-08-18T08:47:59-04:004033370http://forums.asp.net/p/1590757/4033370.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>The ASPNETDB.MDF is the default database for using the ASP.NET Application Services, which includes profiles, roles, membership and more. It gets automatically generated whenever you use one of the above services. I believe you want to use a database which is already exist somewhere on the server. In this case your connection string which you set for the SqlDataSource control must include server name, login and password, like</p> <p>&quot;Data Source=SERVER;Persist Security Info=True;User ID=myId;Password=myPW&quot;</p> 2010-08-18T09:04:07-04:004033400http://forums.asp.net/p/1590757/4033400.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>Where to add it:</p> <p><b>here </b>-&gt; </p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp;&lt;connectionStrings&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp;&lt;add name=&quot;ThisIsMyConnection&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; connectionString=&quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; providerName=&quot;System.Data.SqlClient&quot; /&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp;&lt;/connectionStrings&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; <p></p> <p>&nbsp;&nbsp;&lt;connectionStrings&gt;</p> <p>&nbsp;&nbsp; &nbsp;&lt;add name=&quot;ThisIsMyConnection&quot;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; connectionString=&quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true&quot;</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; providerName=&quot;System.Data.SqlClient&quot; /&gt;</p> <p>&nbsp;&nbsp;&lt;/connectionStrings&gt;</p> &lt;div&gt;<b>or -&gt; </b>in SqlData Control&lt;/div&gt; <p></p> <p></p> 2010-08-18T09:19:44-04:004033402http://forums.asp.net/p/1590757/4033402.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>It must be in the web.config file.</p> 2010-08-18T09:21:55-04:004033415http://forums.asp.net/p/1590757/4033415.aspx/1?Re+Unable+to+make+connection+to+database+Re: Unable to make connection to database? <p>here's what in my webconfig file:</p> <p>connectionString=&quot;data source=.\SQLEXPRESS;Integrated Security=SSPI; Persist Security Info=True;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true; User ID=___\veschich;&quot;</p> <p>but i'm not sure about some stuff.</p> <p><br> </p> <p>My server name = &quot;____\VESOMANIA&quot;</p> <p>My user name = &quot;____\veschich&quot;</p> <p>i don't have a password.</p> <p>Is this the way webconfig has to be?</p> <p><br> </p> 2010-08-18T09:32:02-04:00