Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

peacefulmember

@peacefulmember
About
Posts
28
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reflection - GetValue question
    P peacefulmember

    Hi All, Using Reflection I am trying to get properties of a class I have created. I am doing this, so I do not have to make coding changes with any additional property added to the class. Getting the properties list is working but I am having trouble reading the value of the property. Not sure how and what parameters to be passed for GetValue funtion. Could anybody please help me with GetValue statement? Thanks in Advance!

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim Members As Collection = Family.Members()
    For i As Integer = 1 To sqlColl.Count
    GetMemberInfo()
    Next

    End Sub
    

    Sub GetMemberInfo()
    Dim oMember As New Member
    Dim objType As Type = oMember.GetType()
    Dim sName As String, svalue As Object
    'Dim properties As System.Reflection.PropertyInfo() = objType.GetProperties()
    For Each srcProperty As System.Reflection.PropertyInfo In objType.GetProperties()
    sName = srcProperty.Name
    svalue = srcProperty.GetValue(oMember , Nothing)
    Response.Write(i & " - " & sName & (svalue Is Nothing) & "<br />")
    Next
    End Sub

    'Classes are like

    Public Class Member
    Private _name As String
    Private _age As Integer

    Public Property Name() As String
        Get
            Return \_Name
        End Get
        Set(ByVal value As String)
            \_Name = value
        End Set
    End Property
    Public Property Age() As Integer
        Get
            Return \_age
        End Get
        Set(ByVal value As Integer
            \_age = value
        End Set
    End Property
    

    End Class

    Public Class Family
    Private Shared MemberCollection As Collection = Nothing
    Shared Sub AddMember(ByVal Info As Member)
    Dim thisFamily As New Family
    thisFamily.AddToCollection(Info)
    End Sub
    Private Sub AddToCollection(ByVal Info As Member)
    If MemberCollection Is Nothing Then MemberCollection = New Collection
    MemberCollection .Add(Info)
    End Sub

    Shared Function Members() As Collection
    Dim thisFamily As New Family
    Return thisFamily.getMembersColl()
    End Function
    Private Function getMembersColl() As Collection
    Return MemberCollection
    End Function
    Shared Function getCount() As Integer
    Return Members.Count
    End Class

    ASP.NET question help

  • How to - log queries
    P peacefulmember

    By queries I meant all the queries excuted to render one page. In my aplication one page is generated with multiple queries. Thus, I want user to click on a button (which I have on every page) and then see all the queries executed to build that page. I am not clear how a server call can help? These queries are neither stored on the database side nor I want to save it in a file or in database. I would like to achieve this by keeping it in memory or stream etc. I was thinking on either saving the sqls in javascript or was also thinking on lines of TraceListener. I am just not sure how? Anybody has better approach, please suggest with a solution. Thanks

    ASP.NET c++ performance tutorial question

  • How to - log queries
    P peacefulmember

    Hi All, I need to write a module to log all queries ran on a page. Once the page is loaded, limited users can pull this information with a click on client side to see. - This log should not be stored anywhere but in memory, which means the scope of this information is only the native page. Does anybody have any idea how this can be achieved? Any idea will be appreciated.

    ASP.NET c++ performance tutorial question

  • Executing stored procedure
    P peacefulmember

    Yes, you answered it right. I changed the variable from userID to sID, w/o changing the scope or syntax, it worked. Thanks a lot for your help. :-)

    ASP.NET database help sharepoint question

  • Executing stored procedure
    P peacefulmember

    Great!..Thanks for the explaining it in deatil. Now I understand. Well, I tried the way you have suggested. I still get error :-(. I have defined parameters like cmd.CommandText = "Employees.EmpDept" cmd.CommandType = Data.CommandType.StoredProcedure cmd.Parameters.Add("userid", OracleType.VarChar) cmd.Parameters("userID").Direction = Data.ParameterDirection.Input cmd.Parameters("userID").Value = sUserID cmd.Parameters.Add("retVal", OracleType.Number) cmd.Parameters("retVal").Direction = Data.ParameterDirection.ReturnValue Now I get following error ORA-06550: line 1, column 17: PLS-00306: wrong number or types of arguments in call to 'EMPDEPT' ORA-06550: line 1, column 7: PL/SQL: Statement ignored I checked the definition of procedure, its like CREATE OR REPLACE PACKAGE BODY EMPLOYEE IS FUNCTION EMPDEPT(sID IN VARCHAR2) RETURN NUMBER IS vDept NUMBER; BEGIN ...select statement here ... END EMPDEPT; END; / Now, what I am missing here?

    ASP.NET database help sharepoint question

  • Executing stored procedure
    P peacefulmember

    Thanks for quick response. I will give it a try...but what is wrong with specifying input variable like this. I used to do the same in asp.

    ASP.NET database help sharepoint question

  • Executing stored procedure
    P peacefulmember

    Hi all, Could anybody please help me with the following lines of code to execute stored procedure that takes one parameter and returns a number...I tried all oraclecommnad class methods to execute this SP, I get error all the time. Dim cn As New System.Data.OracleClient.OracleConnection(connStr) Dim cmd As New OracleCommand cn.Open() cmd.Connection = cn cmd.CommandText = "{? = call Employees.EmpDept('" & empID & "')}" cmd.CommandType = Data.CommandType.StoredProcedure cmd.Parameters.Add("retVal", OracleType.Number) cmd.Parameters("retVal").Direction = Data.ParameterDirection.ReturnValue cmd.ExecuteNonQuery() --- this statement creates following error PLS-00103: Encountered the symbol "{" when expecting one of the following: ( - + case mod new not null avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe

    ASP.NET database help sharepoint question

  • Passing VB variables to Javascript code
    P peacefulmember

    Yes, this way jsVar will be availeble on the page, and can be accessed in javascript. Since, this variable is declared on page so, its scope will be page. In case you have two javascript variables that you want to initialized based on you database value, you will have to follow second approach. By doing this you are generating javascript code on the server side that will be available on the page once loaded. HTH

    ASP.NET javascript database tools tutorial question

  • Passing VB variables to Javascript code
    P peacefulmember

    I did it this way after reading variables from database. Do not know if there is another better way.Dim jsScript As String jsScript = "jsVar = '" & VBVar & "';" Dim cs As ClientScriptManager = Page.ClientScript If (Not cs.IsStartupScriptRegistered("InitJSVar")) Then cs.RegisterStartupScript(Page.GetType(), "InitJSVar", jsScript, True) End If

    ASP.NET javascript database tools tutorial question

  • Access User Control property from Main page
    P peacefulmember

    I tried doing what you mentioned. Did not work! Do I need to assign an ID to the user control? Without that I am not able to findControl on the page.<ucl:myCntrl runat="server" id="uclCntrl" /> On page load: Dim ucl As System.Web.UI.UserControl ucl = Me.Master.FindControl("uclCntl") Response.Write("Found User control " & (Not ucl Is Nothing) & " !") ' I get True for this ucl.Test() 'ERROR: Test is not a member of System.Web.UI.UserControl
    What is wrong here?

    ASP.NET question design sysadmin

  • Access User Control property from Main page
    P peacefulmember

    Hi, Got a user control in my master page. I want to access the prperty of user control from the main page. How can I do that? Thanks
    <%@ Register TagPrefix="ucl" TagName="myCntrl" Src="~/UCL.ascx" %> <ucl:myCntrl runat="server" /> Partial Class UCL Inherits System.Web.UI.UserControl Priavte x as String = "" Public Property ConCatStr() As String Get Return x & "Color" End Get Set(ByVal value As String) Dim x As String = value End Set End Property End Class Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Want to refer controls's ConCatStr property on PostBack End Sub

    ASP.NET question design sysadmin

  • Hi All,
    P peacefulmember

    Well, I have one more question. Like I mentioned based on user control's parameter value I need to perform different client side validation. I could set parameter of user control (have a property, suggest if there is another better way), but how can I use this property value in Javascript? Thanks for bearing with me.

    ASP.NET javascript html database design question

  • Hi All,
    P peacefulmember

    I do not want to write my javascript in the page itself. Validations are different in the case of different parameters passed to the user control. What do you mean by that javascript function is not dynamic..How can I make it dynamic, if that can lead me to the functionality that I want? So, far I was thinking my javascript is dynamic as I have it in page_load and it will be written to the page after form tag is rendered on the page side. Thanks

    ASP.NET javascript html database design question

  • Session not available in VirtualPathProvider
    P peacefulmember

    A thought!..Can you use cookieContainer!! or HttpApplication instance!!

    ASP.NET help tutorial question

  • Hi All,
    P peacefulmember

    Christian, Custom Validator!! Sorry, I am not too expert with .net. Could you please explain this with an example? Thanks

    ASP.NET javascript html database design question

  • Hi All,
    P peacefulmember

    Sorry, I messed up the subject earlier. But I meant to wish everybody. HI.

    ASP.NET javascript html database design question

  • Hi All,
    P peacefulmember

    I have user control with some standard HTML tags. On one of my HTML button tag I want to perform a javascript validation (a Hello test function for now). I cannot figure out how can I trigger this function from with in my user control on this HTML button tag click event or on usecontrol's click event. Thanks in advance.Partial Class MyUserControl Inherits System.Web.UI.UserControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim js As StringBuilder = New StringBuilder() js.Append("") js.Append("function Hello() { ") js.Append(" alert ('Hello'); }") js.Append("") If (Not Page.ClientScript.IsStartupScriptRegistered("MyScript")) Then Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", js.ToString()) End If End Sub End Class

    ASP.NET javascript html database design question

  • Dynamic dropdown in user control
    P peacefulmember

    Hi, How can I have user control to populate a list with different values when its property value changes at run time? e.g I have Radio buttons :- Animals, birds, Mammles etc. outside the user control. Based on radio button selected user control should populate values. I have created a property for user control to pass chosen radio option. Thanks

    ASP.NET question

  • Refer to html controls in Javascript
    P peacefulmember

    Yes, document.getElementByID("txtName") also returns the object. I have my controls declared in asp:content tag. Does it have anything to do with that? I remove asp:content and put controls in body tag document.frmMain.txtName works.

    ASP.NET question javascript html

  • Refer to html controls in Javascript
    P peacefulmember

    Hi all, How can I refer to my HTML controls declared within tag in javascript? document.frmMain.txtName does not work. Any highlights!!

    ASP.NET question javascript html
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups