.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Help Adding Parameter at Runtime

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net
 

I am getting the following error:

Must declare the scalar variable "@Approved"

Please help me debug my code.  I want to add a parameter to my SqlDataSource1 when certain controls are checked.

 

My Page:

 

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="vacationlist.aspx.vb" Inherits="Supervisors_vacationlist" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

   <div style="position:absolute; top: 101px; left: 224px; width: 583px; height: 71px;">
       
       
       <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
           RepeatDirection="Horizontal" Enabled="True">
           <asp:ListItem Selected="True">View 7 Days Out</asp:ListItem>
           <asp:ListItem>View 30 Days Out</asp:ListItem>
           <asp:ListItem>View All</as


View Complete Post


More Related Resource Links

Enterprize library 4.1 getting output parameter after adding record in db, plz guide

  

Hi,

I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide

Thanks


adding parameter to query string

  

hi all,


how do i add a new parameter to an existing query string?

http://sample.aspx/SessionHandler.aspx?pub=/english&pageurl=/page1.aspx&section=searchengine&seldcity=berlin&selacity=lux&selddate=15-Dec-10&seladate=29-Dec-10&resultby=1&j=f

now i need to add a new parameter say, showsearch.


Syntax error adding a parameter to xp_cmdshell command

  

Hi,

I am trying to add a parameter to a bcp query that will be run in xp_cmdshell but am getting a syntax error at the '+' character.  Been staring at it for two hours and have concluded that  some outside help is needed. 

The command is:

EXEC xp_cmdshell 'bcp "SELECT * FROM [CensusData].[dbo].[Main] where zBarCode = ' + @zBarCode + '"  queryout "C:\temp_housing_data.txt" -T -c -t -S "MyServerName"'

The syntax is on the first '+' character and it simply says "Incorrect syntax near '+'"

Please help.


adding custom functionality to SSRS parameter

  

Hi,

I have a report that has to filter by following parameter combinations.
search by country, search by state, search by city, search country and state, search by country and city, search by state and city,
search by country, state, and city in doing so when country is 'USA' I have to give user the option of choosing either state or country rest its country and city option.
How do I get this done?

Thanks


store procedure parameter sequence Change In runtime...

  

hi...

this is my code:


builder.Append(string.Format("INSERT INTO deads " +
            " (DieID, Title, FName) " +
            "VALUES ( {0}, {1}, {2} )",
            dt_excel_allRows.Rows[1][0].ToString(), dt_excel_allRows.Rows[1][1].ToString(), dt_excel_allRows.Rows[1][2].ToString()))
           




some of my col datatype is nVarchar...

in run time because  my value in my table (dt_excel_allRows) are FARSI ; the sequence of my parameter changed and it cant be executed!!!!!

of course the problem is because of FARSI is rtl languges....

how can i fix the problem...

i can not user sqlPArameter becuse of some reason....

i think some thing like rtl or ltr can fix my problem....but how?

tanx



Adding Parameter in ActivityBuilder

  

In most of the sample code I saw that we add an instance of   DynamicActivityProperty in Property collection of ActivityBuilder. Now this gives me pain while Inspecting this activity. I have to first convert my ActivityBuilder into DynamicActivity then only I can inspect that other wise it gives me errors like variable are not defined or not accessible due to protection level. So can I use something else at the place of DynamicActivityProperty for adding variables and acheive what ever I was acheiving with DynamicActivityProperty.

Please advice.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Create And Run Excel Macro At Runtime in C#

  
You've been tasked with writing a Windows Form application using the .NET Framework that interacts with Microsoft Excel. If you are new to working with Excel in .NET and are having trouble learning how to format certain cells or cell ranges, then this little tip will come in handy. Rather than scour the internet hoping to find the correct set of constants or method syntax for formatting your spreadsheet, use the built in tools in Excel to write the familiar VBA code for you. Then, you can paste the VBA code generated by Excel into the sample C# code below and run it dynamically at runtime.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Adding Search Refinements in SharePoint 2010

  
I have been playing around with SharePoint 2010 Search this morning. I love the new UI. The search refinements panel is just begging to be messed with. In my case I wanted to add the file extension JPG as an Image Type refiner.

Adding Client-Side Confirmation When Deleting

  
The JavaScript confirm(string) function displays its string input parameter as the text inside a modal dialog box that comes equipped with two buttons - OK and Cancel (see Figure 1). The confirm(string) function returns a Boolean value depending on what button is clicked (true, if the user clicks OK, and false if they click Cancel).

How to Localize Windows Forms and Change the Language at Runtime

  
Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

dynamically adding sql server columns based on number of files in fileuploader

  

I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

 

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

 

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")

objConn.Open()

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend