ironhide1975
Programmer
I have a very simple ASP.Net page I created, and I just want to move the inline code to a code-behind page. I was told you can't do this without Visual Studio or something to create a Project with DLL's. Can someone let me know if it's possible to move this to a code-behind page and if so, how do you change the page to reference the code behind if you have no visual studio project setup?
Code:
<%@ Page Language="vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script language="vb" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim Search As String
Dim Conn2 As SqlConnection
Dim sSQL As SqlCommand
Search = "WhoDidWhatID"
Try
Conn2 = New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
sSQL = New SqlCommand("Exec GENERAL_WhoDidWhat_FindSortCHR '" & Search & "',''", Conn2)
Conn2.Open()
Dim DS As SqlDataReader = sSQL.ExecuteReader()
MyDataGrid.DataSource = DS
MyDataGrid.DataBind()
Finally
Conn2.Close()
End Try
End Sub
</script>