나는 MS SQL 데이터베이스에 온라인으로 연결하는 많은 방법을 찾고 있습니다. web.config에서 연결 문자열을 사용하고 있습니다. 우리가 원하는 바를 위해 완벽하게 작동하며 다음과 같이 보입니다.ASP 데이터베이스 연결 질문
<connectionStrings>
<add name="xxx"
connectionString="SERVER=xxx;UID=xxx;Trusted_Connection=Yes;DATABASE=xxx;"
providerName="xxx" />
</connectionStrings>
연결하는 가장 좋은 방법입니까? 그때
- 내가이 올바르게에 대해 건가 ASP 웹 형태의 응용 프로그램은 대부분의 gridview에게
<asp:SqlDataSource ID="MatchDataSource" Runat="server" SelectCommand="SELECT * FROM [xxx].[Matcxxxh]" UpdateCommand="UPDATE [xxx].[Matxxxch] SET [xxx] = @xxx, [xxx] = @xxx, [xxx] = @xxx WHERE [email protected] [email protected]" ConnectionString="<%$ ConnectionStrings:xxx %>"> <UpdateParameters> <asp:Parameter Type="String" Name="CSISN"/> <asp:Parameter Type="String" Name="ProcName"/> </UpdateParameters> </asp:SqlDataSource> <asp:GridView ID="GridView1" Runat="server" DataSourceID="MatchDataSource" Width="100%"> <RowStyle BackColor="white" ForeColor="black" Font-Italic="false" BorderColor="Black" /> <Columns> <asp:TemplateField SortExpression="xxx" HeaderText="xxx"> <EditItemTemplate> <asp:TextBox ID="editxxx" Runat="server" Text='<%# Bind("xxx") %>' MaxLength="15" ToolTip="Enter CSI SN"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" ErrorMessage="You must provide a xxx." ControlToValidate="editxxx">*</asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate><asp:Label Runat="server" Text='<%# Bind("CSISN") %>' ID="Label1"></asp:Label></ItemTemplate> </asp:TemplateField>
내 질문을 사용하여 그것을된다 사용하고 있습니다?
- 모범 사례를 보여줄 적절한 자습서를 알려줄 수 있습니까?
- 스크립트 실행이 끝나면 어떻게 연결을 닫을 수 있습니까?