G
Guest
Hello,
I have this page however the sqlclient is not defined, i thought you just
had to put
Imports system
Imports System.Data
Imports System.Data.SqlClient
into the page but that just gives me syntax errors.
what am I missing to get sqlclient to work.
also how do i get SqlDbType command to work..
Tdar
Page as follows:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<%
Dim cnStr As String
cnStr =
ConfigurationManager.ConnectionStrings("SilverQueen_Main_SystemConnectionString1").ConnectionString
Dim SqlConnection1 As New Data.SqlClient.SqlConnection(cnStr)
Dim backUpDB As SqlClient.SqlCommand
backUpDB = New SqlClient.SqlCommand
backUpDB.CommandType = CommandType.StoredProcedure
backUpDB.CommandText = "BackUpDBSproc"
backUpDB.Connection = SqlConnection1
'not sure if this is how to add parameter need to figure this out
backUpDB.Parameter.Add("tranid", SqlDbType.Int).Value = intYear
SqlConnection1.Open()
backUpDB.ExecuteNonQuery()
'have to find out how to get a single response back from the sql sp...
SqlConnection1.Close()
%>
</body>
</html>
I have this page however the sqlclient is not defined, i thought you just
had to put
Imports system
Imports System.Data
Imports System.Data.SqlClient
into the page but that just gives me syntax errors.
what am I missing to get sqlclient to work.
also how do i get SqlDbType command to work..
Tdar
Page as follows:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<%
Dim cnStr As String
cnStr =
ConfigurationManager.ConnectionStrings("SilverQueen_Main_SystemConnectionString1").ConnectionString
Dim SqlConnection1 As New Data.SqlClient.SqlConnection(cnStr)
Dim backUpDB As SqlClient.SqlCommand
backUpDB = New SqlClient.SqlCommand
backUpDB.CommandType = CommandType.StoredProcedure
backUpDB.CommandText = "BackUpDBSproc"
backUpDB.Connection = SqlConnection1
'not sure if this is how to add parameter need to figure this out
backUpDB.Parameter.Add("tranid", SqlDbType.Int).Value = intYear
SqlConnection1.Open()
backUpDB.ExecuteNonQuery()
'have to find out how to get a single response back from the sql sp...
SqlConnection1.Close()
%>
</body>
</html>