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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Help Needed working our sp from vb.net code behind

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

I have a formview and am trying to run this code behind but keep getting this error

Procedure or function 'spCBI_ClientUpd' expects parameter '@op_status', which was not supplied


    Protected Function UpdateClientAdmin() As String
        ' SP UPDATE ClientAdmin 

        Dim ReturnValue As String = String.Empty
        Dim SQL_Connection As New SQL.SqlConnection
        Dim SQL_Command As New SQL.SqlCommand
        SQL_Connection = New SQL.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("CashbacsMainConnectionString").ConnectionString)
            SQL_Command.CommandText = "CASHBACSMAIN.dbo.spCBI_ClientUpd"
            Dim pLicence As New SQL.SqlParameter("@Licence", Data.SqlDbType.VarChar, 6)
            pLicence.Value = TxtLicence.ToString
            pLicence.Direction = Data.ParameterDirection.Input

            Dim pCompany As New SQL.SqlParameter("@CompanyName", Data.SqlDbType.VarChar, 6)
            pCompany.Value = CType(FormView1.FindControl("CompanyNameTextBox"), TextBox).Text
            pCompany.Direction = Data.ParameterDirection.Input

View Complete Post

More Related Resource Links

Code write file asp.net 2.0 is working in firefox but IE not working.

If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   

Remove items from a list literally not working as needed

This is why SharePoint drives me insane.  Everything I have been able to find on the web says I *can* programmatically remove list items from a list, all I have to do is a declining loop.  I have even copied verbatium several code examples found in this forum and on the web and every last one of them gives me a "Collection was modified; enumeration operation may not execute." error in the Event log.  This is a C# Windows Form Application we want to use to remove a common announcement from any announcement list in our entire site (top down).  We can *add* it to every announcement list without issue (seperate code).  Can anyone point out to us the error in our code below? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.SharePoint; using System.Text; using System.Reflection; using System.IO; using System.Diagnostics; using System.Xml; namespace RemoveAnnouncement { public partial class RAForm : Form { public RAForm() { InitializeComponent(); } private void removeAnnouncment_Click(object sender, EventArgs e) { const string a = "Application"; try { if (tlsURL.Text.ToString() == "http://" || tlsURL.Text.ToString() == &qu

Convert VB Code to working C# code

Hello. I am a beginner and I'm trying to work my way through the MSDN  beginner tutorials. The lesson I am working on had to do with transferring info to another page using a Session object. The example video is written in VB code. I tried to write this part of the lesson in C# code and where the VB code works I am getting an Error message in C# code saying 'The name 'Session' does not exist in the current context' and hence the program will not compile. here is VB Code on default.aspx page     Protected Sub nextButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles nextButton.Click     Dim bill As New Billing bill.FirstName = firstNameTextbox.Text Session.Add(   "billingInformation", bill) Response.Redirect(   "SessionResult.aspx") End Sub VB SessionResult.aspx code is:     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load     Dim bill As Billing = Session("billingInformation")     Dim sb As New System.Text.StringBuilder() sb.Append(   "First Name: ") sb.Append(bill.FirstName) sb.Append(   "<br>") Response.Write(sb.ToString())     End Sub My C# code looks like this for default.aspx page and SessionResult.aspx page &nb

Working with Code Snippets in VS.NET

INTRODUCTION Creating code snippets using VS.NET is very useful tip because it may help you when you need to write code repeatedly within your applications. For instance, we may use try catch finally block very often. Rather than writing the complete code-block manually, we may save it as a Code Snippet, then use it anywhere we want. In this blog post, I will show you how to create, save and use Code Snippets, where you will see why Code Snippets are extremely useful, especially if you know that you may have various cases where you will apply such or similar code-blocks. WORKING WITH EXISTING VS.NET CODE SNIPPETS Microsoft has provided us with code snippets that developers use in most of the cases. In order to see the already existing code-snippets, in code-behind of your .net application, use the following shortcut keys: CTRL+K+X Insert Snippet will appear you can select one of the given folders, and some predefined code snippets will appear The line above the snippets shows the path to the snippet (1) where you can write the shortcut key of the snippet you want to insert (for faster approach). In our case, we select the try (2) snippet, which will insert the following code:         void MyMethod()         {            &nbs

Ldap authenication code is not working with IIS but works with Visual Studio developement webserver

Hi,I have weird issue here, I have a method that  takes a login Id and authenticates with LDAP active directory and returns the employee Id.It works great when I run the application in Visual studio 2008 ( it uses the default visual studio developement webserver). The code authenitcates the login id and returns emp Id perfectly. But the problem comes when I publish the code to the Local IIS in my developement PC.public string GetEastWestTeamMembersEmployeeID(string loginID)        {            string domain = string.Empty;            string login = string.Empty;            int position = loginID.IndexOf(@"\");            string empid = "";                  System.DirectoryServices.DirectoryEntry directoryEntry = null;            if (position >= 0)            {                domain = loginID.Substring(0, position);    &n

Code in an event handler not working when used with system reflection.

Hi, I am presently writing an application that uses an MDI form with a ToolStrip on it. I have the need to build the menu items dynamically using an XML file. The format of the XML file is as follows: <ContextMenu EventHandlerHost="vFrmPDUsetup"> <!-- These styles will be applied to the menu items. Individual menu item styles can be override by defining as an attibute to the specific menu item, see below --> <Style> <MenuStripBackColour>Transparent</MenuStripBackColour> <BackColour></BackColour> <ForeColour>Chartreuse</ForeColour> <BackImage></BackImage> <!-- Must exist in Images folder --> <FontName>Tahoma</FontName> <FontSize>10</FontSize> <FontStyle>Bold</FontStyle> </Style> <!-- Attributes: Key = Resource Key name in resource file Image = image to display before text, image must exist in Images folder BackImage = background image, image must exist in Images folder BackColour = background colour as colour name ForeColour = foreground colour as colour name FontSize = size of font as value Seperator = add a menu seperator OnClick = click event pointing to the event handler method which must be defined as the MenuItem_ + <attibute value> &

Help needed in versioning through code in document library?



I have a situation where i need to move the document form one library(LB1) to another library (LB2) thorugh event handler code. For documents which are not available in LB2 it is working fine but a case where document is already existing in LB2 i need to maintain the version instead , whereas my code is replacing the document already present.

Can anybody help me getting the versioning done through code?


Many Thanks



Format Code D0 is not working in SSRS 2008


We are trying to migrate all our RDL from SSRS 2005 to SSRS 2008.

In the rdl’s we defined format code for a  text box as “D0”  which is working fine in SQL 2005.

While migrating the rdl’s to 2008 it is not working and data is showing for that text box as “#Error”.

How to resolve this . I am having around 1000+ rdl’s to update with proper format string.

If I open the Rdl in BIDS I am getting below error.


[rsInvalidFormatString] The Format value for the textrun ‘textbox1_0_13.Paragraphs[0].TextRuns[0]’ is not valid. Format specifier was invalid.

[rsRuntimeErrorInExpression] The Value expression for

AJAX DropDownList won't populate.. error500.. code is working though.


Here's what I have.  I was able to debug and traverse through the webservice and return teh array back into the first call method of: return new CarsService()..  But back in the page_load method, I can't get it to update and show up in the page.  what am I doing wrong?!?!


<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1"
                     Category="Make" PromptText="Please select a make" LoadingText="[Loading makes...]"  

Code behind feature not working



I am using WSS 3.0 on Win 2003 and SPD 2007.

I have created a list and created a customized the corresponding NewForm.aspx to with different sub headings as there are many columns and named it NewForm_v2.aspx. To this I've added a label and button to test code-behind features.

The problem:

I have created built a class library in VS2005 > assigned the key etc and finished all other formalities. Changed inheritance tags as well in NewForm_v2.apsx. But when I press the button it is not invoking the method present in the class library (The button should change the text in the label)

My next question is how to debug my code-behind? I've read some articles and tried, but could not hit my break point yet ...

Thanks for your help!


Code working in Xp bur showing Error in Vista


Hi all.


I am saving two data, One is date and other one is time in SQL server 2005 using asp.net ( VB.net).

I am saving this using following command:

cmd.commandtext = "insert into TABLE1 values ('" + Now.toshortdatestring + "', '" + Now.toshorttimestring + "')"


now while i am using this code in Windows Xp its working properly but in Windows VISTA it is showing some "Data Conversion Error  from string to datetime". 

If i remove the single quotes [ ' ] from the command it is showing error in the value of date and time.

thanks all



SlideShow extender working with code behind in VisualBasic


what i am trying to achieve is a single image control with slideshow extender attached which when of the category option buttons are pressed the SlideService goes get the images for that category from the image folder sub folders and starts to display them -

i have got the code to work as to, the point that i have to hardcode the images  sub folders path in to the webmethod - but i want the image folder name to be passed as a parameter when the webmethod GetSlides is called - the code i have so far is

From the aspx page - (the category name will be a string retrieved from the button text when clicked

<asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:Panel ID="Panel1" runat="server">
<asp:Button ID="Button1" runat="server" Text="category 1" />
<asp:Button ID="Button2" runat="server" Text="category 2" />
<asp:Button ID="Button3" runat="server" Text="category 3" />
<asp:Button ID="Button4" runat="server" Text="category 4" />
<asp:Panel ID="Panel2" runat="server&qu

Help needed amending code for rdlc export to PDF


 VS2010 & SQL2010

I have a RDLC Report with various subreports. Using examples from this site I have managed the following code. What I am stumped on getting the pdf auto saved to a specified directory

can anyone help


   Private Sub CreatePDF(ByVal fileName As String, ByVal InvoiceNumber As String)

        InvNumber = InvoiceNumber
        ' Create Report DataSource
        Dim rds_INV_Header As New ReportDataSource("INV_Header", loadInvHeader_data(InvoiceNumber))
        ' Variables   
        Dim warnings As Warning()
        Dim streamIds As String()
        Dim mimeType As String = String.Empty
        Dim encoding As String = String.Empty
        Dim extension As String = String.Empty

        ' Setup the report viewer object and get the array of bytes   
        Dim viewer As New ReportViewer()
        viewer.ProcessingMode = ProcessingMode.Local
        viewer.LocalReport.ReportPath = ".\Reports\Parent_Bureau_Invoice.rdlc"
        AddHandler viewer.LocalReport.SubreportProcessing, AddressOf SetSubReportDataSource
        ' Add datasource here
        Dim bytes As Byte() = viewer.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamIds, warnings)

        ' Now that you h

Regular Expression needed for 10, 11, or 12-digit number in code behind


Hi there,

I am in need of validating a number that can be 10, 11, or 12 digits in lenght.  It cannont contain any spaces, symbols, or letters.  I have to do this in the code behind of my web form.  I am using C# ASP .NET 2.0. 

Code working in XP / 32 bit won't work in Win 7 / 64 bit - "Input string was not in a correct forma


I'm working on a program in VS 2008 / XP 32 bit. So far everything has been working
fine in both XP 32 bit and Win 7 / 64 bit - until I introduced the following piece of

        private void DateFilter()
            // strDate = "MM/dd/yyyy";

            // convert strDate to yyyyMMdd
            strConvYear = strDate.Substring(6, 4);
            strConvMonth = strDate.Substring(0, 2);
            strConvDay = strDate.Substring(3, 2);
            strConvDate = convYear + convMonth + convDay; // yyyyMMdd
            intConvDate = Convert.ToInt32(strConvDate);

            // convert DateTimePicker (dtpSortDates) format yyyy-MM-dd to yyyyMMdd
            intDtpSortDates =

Advice Needed - Suspicious Stored Procedure Code

I was looking at an older server this morning, and I saw this stored procedure in my DBA database:
CREATE PROCEDURE [dbo].[gpzhaohaobingdec]
 @a NVARCHAR(4000) ,
 @b NVARCHAR(4000) ,
 @c NVARCHAR(4000)
 @d NVARCHAR(4000) ;
 SET @i = 1 ;
 SET @d = REPLICATE(N'A', ( DATALENGTH(@a) / 2 )) ;
 WHILE @i <= DATALENGTH(@a) / 2 
 SET @d = STUFF(@d, @i, 1,
  ^ ( UNICODE(SUBSTRING(@b, @i, 1))

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.
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