| | |
Result is not getting from Stored Procedure
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2008
Posts: 3
Reputation:
Solved Threads: 0
Hi,
I am not getting any results from stored procedure ,passing a parameter to the stored procedure . My code is
Thanks in advance
I am not getting any results from stored procedure ,passing a parameter to the stored procedure . My code is
asp Syntax (Toggle Plain Text)
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Web.UI" %> <script language="VB" runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Trace.Write("This msg is from checkdetails") Dim aCol As Integer Dim aNumColumns As Integer Try Dim MyConnection As SqlConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("StudentInfoSystemConnectionString").ConnectionString Dim MyCommand As SqlCommand = New SqlCommand() MyCommand.CommandText = "sp_listall_reporttables" MyCommand.CommandType = CommandType.StoredProcedure MyCommand.Connection = MyConnection Dim IdParam As SqlParameter = New SqlParameter("@tableName", "calendar_Check1") IdParam.ParameterName = "@tableName" IdParam.DbType = DbType.String IdParam.Direction = ParameterDirection.Input MyCommand.Connection.Open() MyCommand.Parameters.Add(IdParam) Dim Adapter As SqlDataAdapter = New SqlDataAdapter(MyCommand) Dim DataSet As DataSet = New DataSet("List Tables") Adapter.Fill(DataSet) gdCheckDetails.DataSource = DataSet.Tables(0) MyCommand.Dispose() MyConnection.Dispose() Catch Ex As Exception Throw New Exception("Error setting column captions.", Ex) End Try End Sub </script> <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!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> <form id="form1" runat="server"> <div> <strong>Sub Reports</strong> <asp:gridview ID="gdCheckDetails" runat="server" > </asp:gridview> </div> </form> </body> </html>
Thanks in advance
Last edited by peter_budo; Aug 1st, 2008 at 1:50 pm. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Aug 2008
Posts: 3
Reputation:
Solved Threads: 0
I found out what the problem was. My Stored procedure doesn't have any output .So I thought in ASP.net will display the column headers of the resultset like in SqlServer.When I execute in the sqlserver it was showing the column headers ,so I was expecting that in ASP.net.
Thanks Guys, responding to my question
Thanks Guys, responding to my question
![]() |
Similar Threads
- PHP MySQL 5.0 stored procedure (PHP)
- PHP MSSQL Stored Procedure with Parameters (In and Out) (PHP)
- C# program retrieving result set from SQL Stored Procedure (C#)
- how to call Stored Procedure in mysql by php (PHP)
- Calling and executing stored Procedure (C)
- How to convert strSQLStmt result to integer? (VB.NET)
- How to add to a result (ASP.NET)
- ASP.net/Stored Proc & Login Verification (ASP.NET)
- Stored procedure call with ADO (C)
Other Threads in the ASP.NET Forum
- Previous Thread: Uploading Word File
- Next Thread: Put the value in File upload control
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





