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


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

Public Shared function doubt????

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net
 
Hi
I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.

Pankaj



View Complete Post


More Related Resource Links

Use a WPF control in a Public Shared function

  

Hello,

I am trying to write a program that uses a button on one window to alter a control in another window.  I have a Public Shared Sub declaration in the window I wish to alter, but I cannot put in the code to make the changes to the control (error is "Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class").  How can I get around this so I can change a control's properties from within a Public Shared function?

Thanks!


Access Public Function in MasterPage

  
Hi,I need help in accessing the function in my masterpage.I have a.master and b.aspx with the content page.Now in the page load of my content page, I want to execute the an sql query which is in a function in my master page.How can I access the function in my master page??code in my master page:public function info () as string'SQL Queryend function

Public Shared Properties, where are they stored?

  

I have the following code in a class in which I call from different pages, I wanted to know where this info is being stored at as I can see it from different pages.


Public Class SampleProperties

    Public Shared _OrderID As Integer

    Public Shared Property MagicOrderID() As Integer
        Get
            Return _OrderID
        End Get
        Set(ByVal value As Integer)
            _OrderID = value
        End Set
    End Property

End Class



Also, is this saved on the browser session? IIS? will whatever being set from 1 user be affected by every other user on the site?11


Public Function Testing (ByVal FirstString as String, ByVal FirstInteger as Integer), how to pass a

  

I have the following function, sometimes I want to pass a DBNULL.Value to the function so I update the database with a null value, but it won't let me as the DBNULL.Value is not a string or an integer, how can I get this to work?


Public Function Testing (ByVal FirstString as String, ByVal FirstInteger as Integer), how to pass a DBNULL.Value?

' update database

Return value

End Function





How to call a Public function of a window from another Window in WPF

  

How to call a Public function of a Mainwindow from another Window in wpf using VB.Net?

I checked this thread and tried to implement similar way as follows

1. Created an instance for the main window and declared a public function

Public Interface IMainWindow

 Function Show_Tickets(ByVal p_Para As String) As Boolean

End Interface

2. In the Mainwindow

at Initialization part

Class MainWindow

 Implements IMainWindow

3. Implemented the Function

Public Function Show_Tickets(ByVal p_status As String) As Boolean

Public Function / Sub with multiple options

  

You know how the built in functions in VB.NET gives you the option to pass 1 parameter, 2, 3, or 4 all within 1 function, how do they do that? and when the intellesense comes out, there is a "1 of 4" on the top left of the intellesense and you can click to change and see what the other 4 options are.


Content page control passes as argument to javascript function

  

Here is the content page:

********************************************************************

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
{
   ouput.value = input.value;
   return true;
}
 </script>
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
</asp:Content>

********************************************************************

I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.

  

I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?


NUnit and public static readonly

  

I have an app that I am testing with NUNit.  The project im testing has several helper classes that are created as public static readonly.  When I run the NUnit tests, they all fail with the same error


Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.

I kept getting this error despite stripping out all

Trim function in C Sharp

  
Hi,
How do i use "trim" function in C Sharp? I have a string and i want to strip off spaces from the end of the string. Any idea how do i do it??

Thanks
may~

Pure C++: Invoking Generic or Function Templates

  

As I promised last time, in this month's column I'll walk through the process of defining and invoking a generic or template function under C++\CLI. A function template or a generic function begins with the template or generic keyword followed by its parameter list.

Stanley B. Lippman

MSDN Magazine October 2005


Cutting Edge: Using an Eval Function in Web Services

  

Web Services are often presented as the perfect tool for pro-grammers. They're interoperable, based on open standards such as SOAP and WSDL, and are fully integrated with the Microsoft® . NET platform.

Dino Esposito

MSDN Magazine September 2002


Rotor: Shared Source CLI Provides Source Code for a FreeBSD Implementation of .NET

  

With over 9,000 files, and including some 1300 public classes to pore through, the Shared Source CLI can teach you quite a bit about the internal workings of the CLR. But the sheer amount of source code included can make just starting your exploration a monumental task. This article discusses some of the things you can learn from the source code facsimile of the CLR, like how JIT compilation works. It will also help you understand how to control execution along with debugging and loading classes. A walk through the steps involved in setting up the runtime will let you become familiar with the process.

Jason Whittington

MSDN Magazine July 2002


way of calling "javascript function of parent window from child window."

  
The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">

Need function to find difference between two dates

  

Hi all


I need a function written in vb to find the exact month difference between two dates.


For example

    Start Date : 01/01/2010

    End Date   : 15/02/2010

 then the difference value should be like this 1.5  i.e i need the difference in decimal value.




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