» Home » static » Page 1
Can't access asp controls from static method, but when I remove static, ajax call won't work
by semicolonth in ASP & ASP.net

I have a method called getPersonInfo and it's header looks like this:


[WebMethod]
public static Hashtable getPersonInfo(int personID)
{
}

The problem I am having is that this method cannot access my asp.net controls. So of course I remove the "static" keyword. But then my ajax calls fail since it's not a static method any more. Any suggestions?


Large amounts of static data to populate a webpage - store in a database, or static?
by eferro in Databases

I have a large amount (several gigabytes worth) of archival data that I want to make available to users and search engines through a web interface. Most of the data will rarely change, so I'm debating the best way to store and deliver the data.


I would like to ensure that the data loads quickly and efficiently so it can easily be viewed by users and indexed by search engines without


Scope of Connection Static variable inside static method for the entire application?
by rituraj in Programming Languages

I am having the following approach for logging certain things from my java application to Oracle DB.


Package com.util.dblog;
public class DBLog {
static Connection con = null;
static PreparedStatement stmt = null;
static {
try{
DBConnectionHelper connHelper = DBConnectionHelper.createInstance();
con=connHelper.getConnection("ds"); //

Modifying a globally defined static variable from a static method's mouse listener
by jald in Programming Languages

I'm trying to modify the following globally defined variable:


static int players;

from the following method:


public static void selectPlayers() {
JButton player1 = new JButton("1 Player");
player1.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent arg0) {
players = 1;

I am getting a error saying that cannot make a static reference to the non-static method GetNUmber() from the type Vehicle
by micaleel in Programming Languages

I am getting a error saying that cannot make a static reference to the non-static method GetNUmber() from the type Vehicle.I don't really understand what's happening. Please help!


public class Vehicle
{
private int VehicleNumber;
public void SetNumber (int N){
VehicleNumber = N;
}
public int GetNumber (){
return VehicleNumber;

Does it make any sense to declare a static variable in a class' function where the object is static
by Cadu in Programming Languages

Lets say my class lets say I have


static classA myObject;
void classA::update(int elapsed)
{
static int sumElapsed = 0;
sumElapsed+= elapsed;
}

It seems that my questions is kind of hard to understand. But if we say that myObject is a singleton of classA. Is there a difference between the local static int sumElapsed and a privat


How do I avoid 'call is ambiguous…' errror when writing static and non-static methods in C#?
by tanknique in C & C++ & C#

I have a number of classes that represents business transaction calls: executing appropriate stored procedures.


Now the looks like this:


public static class Request
{
public static void Approve(..) {
using(connection) {
command.Text = "EXEC [Approve] ,,"]
command.ExecuteNonQuery();
}
}<

Parsing date and running into a 'static reference to the non-static method' Error in java
by Imaginer in Java

I have a line in my main like so:


Date gameDate = DateFormat.parse(scanner.nextLine());

Essentially I want to scan in a date with util.Scanner


Which hits the error:


Cannot make a static reference to the non-static method parse(String) from the type DateFormat


Now, I've looked in to this error, but it doesn't seem as clear


Access static fields directly instead of calling a static getter method, is it faster?
by Julian Ivanov in Programming Languages

I'm writing an Android app and I have a class that generates and maintains some fixed URL's that can occasionally change. I keep them all in one class called UrlUtils:


public class UrlUtils {
private static String sUrlBase = "http://google.com";
/**
* Called occasionally
*/
public static void refreshUrlBases() {
sUrlBase = "http:/

Given a list of static libraries and search directories (in GCC/ld format), how to assemble them into a static library
by hondaf17 in Programming Languages

I have a specific problem, but let me first take a stab at formulating it in a general way:


I am working in Linux (openSUSE 12.2 to be exact). The toolchain is quite standard, using make, OpenMPI mpicc (which uses GCC) and so on.


My problem is essentially that I am given a string of link commands as a macro in a makefile (i.e., "-lsomelib -L/some/path -lanotherlib" and s


Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .