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

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

How to connect the OledbCommand object with another Member Function

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net
protected void GridViewTest_RowDeleting(object sender, GridViewDeleteEventArgs e)
       int deleteKey = Int32.Parse(GridViewTest.DataKeys[e.RowIndex].Value.ToString());
       OleDbCommand deleteCommand = new OleDbCommand();
       deleteCommand.CommandType = CommandType.StoredProcedure();
           deleteCommand.Parameters.AddWithValue("@empid", deleteKey);
 private DataTable  Connection1(string Storedprocedure)
       using (OleDbConnection MyConnection = new OleDbConnection(ConfigurationManager.AppSettings[0].ToString()))
           OleDbDataAdapter MyAdapter = new OleDbDataAdapter(Storedprocedure, MyConnection);
           DataTable MyTable = new DataTable();
           return MyTable;

Hello Members,

           I need one help..I Don't know how to connect the command object with
another Member function...
I tried something in the above code...But i got error...Please put me in right direction...


View Complete Post

More Related Resource Links

Can i override the sqlexcption object into ajax OnError function?

Hi Dude, I am little stranger to web service. i do not know how can i implement your given functionality? i will show my webservice and web method. Please let me know how can i override the sqlexption error object to ajax error object? Please help me as soon as possible.. <WebMethod()> _       Public Function AddDetailPageData(ByVal strTableQuery As String, ByVal strFieldName As String, ByVal strFieldData As String, ByVal strWherCond As String)        Dim intRecCount As Integer = 0        Try            Dim param() As SqlParameter = New SqlParameter() _                                {New SqlParameter("@strtableQuery", SqlDbType.NVarChar, 50), _                                New SqlParameter("@strFieldList", SqlDbType.NVarChar, 4000), _                           

Allmembers function expects a hierarchy expression for the argument, a member expression is used" er

  Hi , I have a report that was working before.  After adding couple calculated mesaure, my report is throwing the error.  Here is the query I used.  Can you please help? this was a working prototype, now it is in trouble.  Need to fix it quickly.  thanks a million   SELECT NON EMPTY { [Measures].[sales], [Measures].[%of sales] } ON COLUMNS, NON EMPTY { ([region].[country].[country].ALLMEMBERS * [Fiscal Period].[Fiscal Year].[Fiscal Year].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [sales] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS      

WPF TreeView child nodes - collection is not a member of the first level nodes object



I was wondering if i could use a TreeView to display data from 2 separate collections where both collections are members of the same object. For example i have a view model that has 2 observable collections:



Each model has a property Brand which specifies the brand for each model. What i want to do is bind the first level to the Brands collection and the second level to the Models collection and specify a filter.

Thanks in advance.

Help working with serializable object that contains a non serializable member


Hey guys, I am running into an issue at my job that I was hoping someone in this community could help me out with.

I have been tasked with fixing an issue a user control is having that someone else built.  The user control is a filter control.  It contains a filter control class that holds the raw data for the filter control.  One of the members of the filter control is an Object DataSource.  The page that contains the user control will make a call to add a control which in turn instantiates the filter control class.  One of the arguments passed into the calling method is the object datasource which can be anything from a stored procedure to a list or a datatable returned from the data layer.

Initially the filter control class was stored in view state but then serialization issues started occuring.  It was moved to session state where a random bug was reported that we were unable to recreate at our end.  Also, as my understanding would have it serialization issues that occur in view state will also occur in session state since the object is still undergoing serialization.  So I have been tasked with moving the object from session state and coming up with some other mechanism.

Here is the solution I came up with:

Mark the object DataSource property with the <nonserializable> attribute.  Then either ser

how to create class and acess member using object

hi i am a new user to C# .net can any body help me to write a new class in c# AND HOW TO ACESS methods and members using its object thnks in advance

Reference to a non-shared member requires an object reference in code generated by ASP.NET



I am working on converting a project from C# to VB and am facing this weird issue. 1 page cannot compile and I get the reference error, but the weird thing is that the compiler shows the error as coming from ASP.NET generated code. Visual Studio shows me that error is coming from my ASPX page. I cannot seem to figure out why or where this error is occuring. Also if I take the inherits attribute out I don't get the compilation error. The code in aspx page is below:

<%@ Page Language="VB" AutoEventWireup="true" CodeBehind="diff.view.aspx.vb"  Inherits="MR.ControlApp.diffview" MasterPageFile="~/Site1.Master"%>

<asp:Content ID="Header1" ContentPlaceHolderID="head" runat="server">

    Page: <select onchange="sel(this);">
        Dim j As Integer = 0
        While j < pageCount
           <option <%= IIf(currentPage = ( j + 1 ), "selected", "")  %> value="<%= j+1 %>"><%= j + 1 %></option>
        <%j = j + 1
        End While
    <% 'Print(); %>
    <div style="font-family: verdana; font-size: 10pt; font-weight: bold">
        MDM Data Inconsiste

Reference to a non-shared member requires an object reference


This is detaining me from transferring my website to another webserver.  So much for a seamless transfer. I had no problem ever with the following line on several pages on my site:

  <%Dim cust As New BusinessLogic.SiteUser(CInt(BusinessLogic.SiteUser.CurrUserID))%>

This line is used on 4 other pages just like above. The vs 2008 is whining with this error message.

I opend my 2005 vb.net site into VS 2008 and it asked me if I wanted to upgrade for .net 3.5 and I said yes. I cannot debug and I get the mentioned error. Visual Studio 2005 gives NO such error. What is the issue?  How can I resolve this?

What is a non-shared member? I don't think I should have to change anything in my business logic area. Can this line, which does 2 things, be done in the code behind? Or partly in the code behind so as to not give this error?

<%@ Page Language="VB"  AutoEventWireup="false" CodeFile="paypal_featured.aspx.vb" Inherits="paypal_paypal_featured" title="Untitled Page" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <form action="<%=paypalurl%&g

Reference to a non-shared member requires an object reference


I do not receive this error when I open my website application in vs 2005. When I open in vs 2008, I get this error. What gives?

These lines are underlined in blue:

<%Dim cust As New BusinessLogic.SiteUser(CInt(BusinessLogic.SiteUser.CurrUserID))%>

Businesslogic area is imported into each of 3 pages with this line. 

Getting Object required, but page function still works..


Want to clear the yellow exclamation point in the browser.. it builds fine, it works fine, but if you happen to look down in the bottom or your browser is setup to display these errors, you will get  an error message that reads

Object Required
Code: 0
Line: 13

When i view the source of the page here is what i have for those lines, then below that is how its written in the aspx page, what did i miss or do wrong?


<script type="text/javascript">
        function showsearchMenu(num) {
            for (var i = 0; i <= 4; i = i + 1) {
                if (i != num)
                    document.getElementById('searchNav' + i).style.display = "none";  --------------->>> This is line 13
                    document.getElementById('searchNav' + i).style.display = "block";
        function goSearchOption(theoption) {
            for (var i = 1; i <= 3; i = i + 1) {
                if (i != theoption)
                    document.getElementById('searchOption' + i).style.display = "none";
                    document.getElementById('searchOption' + i).style.display = "block";

MDX function for extracting a member set from a tuple set



I'm looking for a function as explained in the title (that takes the member name as a parameter), or for any other way to accomplish that.



Reference to a non-shared member requires an object reference.


I cannot seem to find the answer to this error.  I have read all the posts I could find but nada seem to work.


Here's what I have


Sub Page_Load

Dim clsTest As New clsTest

     Dim myTest As String = clsTest.Test1()    <-- Error Reference to non-shared member requires an object reference

 End sub


Imports System
Imports Microsoft.VisualBasic
Imports System.DateTime
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Imports System.Data.Linq.DataContext

Imports System.Web
Imports System.Web.UI.Page
Imports System.Web.HttpRequest
Imports System.Collections

Public Class clsTest

   Public Shared Function Test1() As String

      Return "Test1"

   End Function

End Class



Thanks for your help







Can I make a generic function that gets any object's name field based on ID?


I find myself writing a lot of functions like this...to get some sort of Name or Text or FullName field, based on the ID ...

        public static string GetAnswerText(int answerID)
            TreatmentIntegrityDataContext data = new TreatmentIntegrityDataContext();
            Answer answer = data.Answers.FirstOrDefault(x => x.AnswerID == answerID);
            if (answer == null)
                return null;
                return answer.AnswerText;

I have one of these functions for almost every object in my database.  Is there a way to consolidate this into one generic function?  For example could I override the ToString() method for every object and then make a generic function GetStringValue(Type T, int primaryKey) that looks up the record based on the ID, and calls the ToString() method for an object of type T?  What would that function look like?

I think it must be possible because I've playing around with a Dynamic Data website which does similar things ... I'm just not sure how to look up the record with a generic type.

Thanks in advance!!

ActiveX component can't create object error when trying to connect Analysis Server


I'm current on a SQL 2000 Standard Edition enviroment and when I launch the Analysis Server Manager, the Analysis Servers/database has a red box. I right-click, select connect and I get an error displaying:

"ActiveX component can't create object"


can someone point me to an article or a solution for this error.

grately appriciate it, thank you,


Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.
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