Daily Archives

Articles indexed Friday March 4 2011

Page 8/13 | < Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • python/django problem with sessions and language

    - by freakish
    Hello everyone! I have the following problem: on the main page I can change language. New language is saved in request.session['django_language']. I also have SESSION_COOKIE_DOMAIN set to my site, so session should be inherited by subdomains. And it is, because after changing language I check request.session['django_language'] in subdomains and it's fine. Then I use django.middleware.locale.LocaleMiddleware to translate my pages. And it works perfectly... only on main site! If I change language and refresh main site - it is ok. However, if I change language and go to a subpage (for example /LogIn), then the page is NOT translated at all. It stays on default language. This is really strange, because if I use {% load i18n %} {% get_current_language as lang %} in this subpage, then lang is good language. There is no mistake. What kind of problem can it be? Some suggestions?

    Read the article

  • How do I declare a constructor for an 'object' class type in Scala? I.e., a one time operation for the singleton.

    - by Zack
    I know that objects are treated pretty much like singletons in scala. However, I have been unable to find an elegant way to specify default behavior on initial instantiation. I can accomplish this by just putting code into the body of the object declaration but this seems overly hacky. Using an apply doesn't really work because it can be called multiple times and doesn't really make sense for this use case. Any ideas on how to do this?

    Read the article

  • NSIS takes ownership of IIS system files

    - by Lucas
    I recently encountered an issue with NSIS that I believe is related to an interaction with UAC, but I am at a loss to explain it and I do not know how to prevent it in the future. I have an installer that creates and removes IIS virtual directories using the NsisIIS plugin. The installer appeared worked correctly on my Windows 7 workstation. When the installer was run on a Windows 2008 R2 server it installed properly, but the uninstaller removed all of the virtual directories and put IIS is an unusable state; to the point that I had to remove the Default Web Site and re-add it. What I eventually found was that all of the IIS configuration files under C:\Windows\System32\inetsrv\config had a lock icon on them. Some investigation seem to indicate that this means a user account has taken ownership of the file, however all the files listed SYSTEM as the file owner. I did check a different server that I have not run the installer on, and it does not have the lock icon applied to the IIS files. I have also seen the same lock icon appear on other files that the NSIS installer creates. For instance, I have a Web.Config.tpl file that is processed using the NSIS ReplaceInFile which also appears with the lock icon after the installer finished. After I explicitly grant another user account access to the file, the lock icon goes away. I run the installer under the local Administrator account on the 2008 R2 server, so I do not get the UAC prompt. Here is the relevant code from the install.nsi file RequestExecutionLevel admin Section "Application" APP_SECTION SectionIn RO Call InstallApp SectionEnd Section "un.Uninstaller Section" Delete "$PROGRAMFILES\${PROGRAMFILESDIR}\Uninstall.exe" Call un.InstallApp SectionEnd Function InstallApp File /oname=Web.Config Web.Config.tpl !insertmacro ReplaceInFile Web.Config %CONNECTION_STRING% $CONNECTION_STRING FunctionEnd Function un.InstallApp ReadRegStr $0 HKLM "Software\${REGKEY}" "VirtualDir" NsisIIS::DeleteVDir "$0" Pop $0 FunctionEnd I have three questions stemming from this incident: How did this happen? How can I fix my installer to prevent it from happening again? How can I repair the permissions on the IIS config files.

    Read the article

  • reStructuredText for SQL?

    - by Chris
    I am trying to use DocUtils and reStructuredText to comment SQL code. I can get this to work when I include the markup inside multi-line comments. I then use --Some text:: to introduce each block of code. I cannot get internal hyperlinks to work. I would like to write -- .. Step1_: but the parser ignores this because of the leading comment. Using a multi-line style also fails. Is there a way to get this to work? Here's an example: /* ========== this query ========== :Author: Me Outline ========== - Create table 1 - Create table 2 - Output the result */ -- _Step1: build the table:: create table table1 -- _Step2: use Step1_ to build table 2:: create table table2

    Read the article

  • Networking Multiplayer games in Cocoa?

    - by Conor Taylor
    I have made this game for Mac OS, but I realised that i need to make it better with multiplayer. Im an experienced Cocoa developer (so please, no RTFM's) but for some reason I never even touched on networking. I was wondering how I could send game date from com1 to com2, and vice versa, over different wifi networks. Cheers, Conor Edit: When I say different wifi networks, I mean no bonjour. I want to be able to play the game in the US with a guy in china!

    Read the article

  • Using WIndows PowerShell 1.0 or 2.0 to evaluate performance of executable files.

    - by Andry
    Hello! I am writing a simple script on Windows PowerShell in order to evaluate performance of executable files. The important hypothesisi is the following: I have an executable file, it can be an application written in any possible language (.net and not, Viual-Prolog, C++, C, everything that can be compiled as an .exe file). I want to profile it getting execution times. I did this: Function Time-It { Param ([string]$ProgramPath, [string]$Arguments) $Watch = New-Object System.Diagnostics.Stopwatch $NsecPerTick = (1000 * 1000 * 1000) / [System.Diagnostics.Stopwatch]::Frequency Write-Output "Stopwatch created! NSecPerTick = $NsecPerTick" $Watch.Start() # Starts the timer [System.Diagnostics.Process]::Start($ProgramPath, $Arguments) $Watch.Stop() # Stops the timer # Collectiong timings $Ticks = $Watch.ElapsedTicks $NSecs = $Watch.ElapsedTicks * $NsecPerTick Write-Output "Program executed: time is: $Nsecs ns ($Ticks ticks)" } This function uses stopwatch. Well, the functoin accepts a program path, the stopwatch is started, the program run and the stopwatch then stopped. Problem: the System.Diagnostics.Process.Start is asynchronous and the next instruction (watch stopped) is not executed when the application finishes. A new process is created... I need to stop the timer once the program ends. I thought about the Process class, thicking it held some info regarding the execution times... not lucky... How to solve this?

    Read the article

  • Can I dispose a DataTable and still use its data later?

    - by Eduardo León
    Noob ADO.NET question: Can I do the following? Retrieve a DataTable somehow. Dispose it. Still use its data. (But not send it back to the database, or request the database to update it.) I have the following function, which is indirectly called by every WebMethod in a Web Service of mine: public static DataTable GetDataTable(string cmdText, SqlParameter[] parameters) { // Read the connection string from the web.config file. Configuration configuration = WebConfigurationManager.OpenWebConfiguration("/WSProveedores"); ConnectionStringSettings connectionString = configuration.ConnectionStrings.ConnectionStrings["..."]; SqlConnection connection = null; SqlCommand command = null; SqlParameterCollection parameterCollection = null; SqlDataAdapter dataAdapter = null; DataTable dataTable = null; try { // Open a connection to the database. connection = new SqlConnection(connectionString.ConnectionString); connection.Open(); // Specify the stored procedure call and its parameters. command = new SqlCommand(cmdText, connection); command.CommandType = CommandType.StoredProcedure; parameterCollection = command.Parameters; foreach (SqlParameter parameter in parameters) parameterCollection.Add(parameter); // Execute the stored procedure and retrieve the results in a table. dataAdapter = new SqlDataAdapter(command); dataTable = new DataTable(); dataAdapter.Fill(dataTable); } finally { if (connection != null) { if (command != null) { if (dataAdapter != null) { // Here the DataTable gets disposed. if (dataTable != null) dataTable.Dispose(); dataAdapter.Dispose(); } parameterCollection.Clear(); command.Dispose(); } if (connection.State != ConnectionState.Closed) connection.Close(); connection.Dispose(); } } // However, I still return the DataTable // as if nothing had happened. return dataTable; }

    Read the article

  • I need to modify a program to use arrays and a method call. Should I modify the running file, the data collection file, or both?

    - by g3n3rallyl0st
    I have to have multiple classes for this program. The problem is, I don't fully understand arrays and how they work, so I'm a little lost. I will post my program I have written thus far so you can see what I'm working with, but I don't expect anyone to DO my assignment for me. I just need to know where to start and I'll try to go from there. I think I need to use a double array since I will be working with decimals since it deals with money, and my method call needs to calculate total price for all items entered by the user. Please help: RUNNING FILE package inventory2; import java.util.Scanner; public class RunApp { public static void main(String[] args) { Scanner input = new Scanner( System.in ); DataCollection theProduct = new DataCollection(); String Name = ""; double pNumber = 0.0; double Units = 0.0; double Price = 0.0; while(true) { System.out.print("Enter Product Name: "); Name = input.next(); theProduct.setName(Name); if (Name.equalsIgnoreCase("stop")) { return; } System.out.print("Enter Product Number: "); pNumber = input.nextDouble(); theProduct.setpNumber(pNumber); System.out.print("Enter How Many Units in Stock: "); Units = input.nextDouble(); theProduct.setUnits(Units); System.out.print("Enter Price Per Unit: "); Price = input.nextDouble(); theProduct.setPrice(Price); System.out.print("\n Product Name: " + theProduct.getName()); System.out.print("\n Product Number: " + theProduct.getpNumber()); System.out.print("\n Amount of Units in Stock: " + theProduct.getUnits()); System.out.print("\n Price per Unit: " + theProduct.getPrice() + "\n\n"); System.out.printf("\n Total cost for %s in stock: $%.2f\n\n\n", theProduct.getName(), theProduct.calculatePrice()); } } } DATA COLLECTION FILE package inventory2; public class DataCollection { String productName; double productNumber, unitsInStock, unitPrice, totalPrice; public DataCollection() { productName = ""; productNumber = 0.0; unitsInStock = 0.0; unitPrice = 0.0; } //setter methods public void setName(String name) { productName = name; } public void setpNumber(double pNumber) { productNumber = pNumber; } public void setUnits(double units) { unitsInStock = units; } public void setPrice(double price) { unitPrice = price; } //getter methods public String getName() { return productName; } public double getpNumber() { return productNumber; } public double getUnits() { return unitsInStock; } public double getPrice() { return unitPrice; } public double calculatePrice() { return (unitsInStock * unitPrice); } }

    Read the article

  • iPhone App development for non-programmers

    - by user645479
    I have a English major during college and would like to start my career in mobile application development. I know this won't be easy for someone like me who doesn't have a technical background but I have made up my mind and I am committed to learning to code. What would you recommend to someone who wants to to start learning mobile application development from scratch? What books or college courses/certificates are required?

    Read the article

  • _beginthreadx and socket

    - by user638197
    hi, i have a question about the _beginthreadx function In the third and fourth parameter: if i have this line to create the thread hThread=(HANDLE)_beginthreadex(0,0, &RunThread, &m_socket,CREATE_SUSPENDED,&threadID ); m_socket is the socket that i want inside the thread (fourth parameter) and i have the RunThread function (third parameter) in this way static unsigned __stdcall RunThread (void* ptr) { return 0; } It is sufficient to create the thread independently if m_socket has something or not? Thanks in advance Thank you for the response Ciaran Keating helped me understand better the thread I'll explain a little more the situation I´m creating the tread in this function inside a class public: void getClientsConnection() { numberOfClients = 1; SOCKET temporalSocket = NULL; firstClient = NULL; secondClient = NULL; while (numberOfClients < 2) { temporalSocket = SOCKET_ERROR; while (temporalSocket == SOCKET_ERROR) { temporalSocket = accept(m_socket, NULL, NULL); //----------------------------------------------- HANDLE hThread; unsigned threadID; hThread=(HANDLE)_beginthreadex(0,0, &RunThread, &m_socket,CREATE_SUSPENDED,&threadID ); WaitForSingleObject( hThread, INFINITE ); if(!hThread) printf("ERROR AL CREAR EL HILO: %ld\n", WSAGetLastError()); //----------------------------------------------- } if(firstClient == NULL) { firstClient = temporalSocket; muebleC1 = temporalSocket; actionC1 = temporalSocket; ++numberOfClients; printf("CLIENTE 1 CONECTADO\n"); } else { secondClient = temporalSocket; muebleC2 = temporalSocket; actionC2 = temporalSocket; ++numberOfClients; printf("CLIENTE 2 CONECTADO\n"); } } } What i'm trying to do is to have the socket inside the thread while wait for a client connection Is this feasible as i have the code of the thread? I can change the state of the thread that is not a problem Thanks again

    Read the article

  • Find any type of url, and replace "click here" text with regexp jquery

    - by Takács Zsolt
    Hi! I need a little script in jQ because I have to change the long urls to a shorten "click here" text. I want to change only the url text not the value of href's attrib like this: <a href="http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme">http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme</a> to.. <a href="http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme">click here</a> The script must work on any possible type of url for example: http: https: ftp: and so on... tyvm girls and guys! Regs!

    Read the article

  • PHP & MYSQL: How can i neglect empty variables from select

    - by cash-cash
    hello all; if i have 4 variables and i want to select DISTINCT values form data base <?php $var1 = ""; //this variable can be blank $var2 = ""; //this variable can be blank $var3 = ""; //this variable can be blank $var4 = ""; //this variable can be blank $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE **keywords ='$var1' OR author='$var2' OR date='$var3' OR forums='$var4'** "); ?> note: some or all variables ($var1,$var2,$var3,$var4) can be empty what i want: i want to neglect empty fields lets say that $var1 (keywords) is empty it will select all empty fileds, but i want if $var1 is empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE author='$var2' OR date='$var3' OR forums='$var4' "); if $var2 is empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE keywords ='$var1' OR date='$var3' OR forums='$var4' "); if $var1 and $var2 are empty the result will be like $result = mysql_query("SELECT DISTINCT title,description FROM table WHERE date='$var3' OR forums='$var4' "); and so on

    Read the article

  • Magento: Configurable product options not showing on a view page?

    - by Relja
    I have multi-store Magento system and strange things happen when i try to see a configurable product on my main store - the options select lists don't show up at all! And that is the case for the 95% of the products on the main store. But on the other stores it works fine?! I can't see what am I doing wrong. All my products are configurable, all have set simple products with options attached to them, all are set to be visible on all stores (WebsiteIds attribute), all are enabled on all stores, all simple products are in stock and have some stock quantity set. I think if I've done something wrong it would be like that on all stores, not just the main one. I'm totally clueless, please help. I've attached couple of images to see the difference. http://img51.imageshack.us/img51/3224/59155765.jpg http://img196.imageshack.us/img196/8145/98963713.jpg

    Read the article

  • Rails help looping trough has one and belongs to association

    - by Rails beginner
    This is my kategori controller show action: def show @kategori = Kategori.find(params[:id]) @konkurrancer = @kategori.konkurrancer respond_to do |format| format.html # show.html.erb format.xml { render :xml => @kategori } end end This is kategori view show file: <% @konkurrancer.each do |vind| %> <td><%= vind.name %></td> <td>4 ud af 5</td> <td><%= number_to_currency(vind.vaerdi, :unit => "DKK", :separator => ".", :delimiter => ".", :format => "%n %u", :precision => 0) %></td> <td>2 min</td> <td>Nyhedsbrev</td> <td><%= vind.udtraekkes.strftime("%d %B") %></td> </tr> <% end %> My kategori model: class Kategori < ActiveRecord::Base has_one :konkurrancer end My konkurrancer model: class Konkurrancer < ActiveRecord::Base belongs_to :kategori end I want show all of the konkurrancer that have an association to the kategori model With my code I get the following error: NoMethodError in Kategoris#show Showing C:/Rails/konkurranceportalen/app/views/kategoris/show.html.erb where line #12 raised: undefined method `each' for "#":Konkurrancer

    Read the article

  • Has anyone succeeded in converting files to the mpg-format that a Sony Digital Camera can play?

    - by user645552
    I'm trying to play a mpeg movie on my Sony Cybershot digital camera, it's from a DV-camera converted to MPEG1. But sony refuses to play it with File error. The only files sony can play are from my previous Sony camera. The other way around gives no problem, the movies the camera takes play on various software media players. Has anyone succeeded in converting files to the mpg-format that a Sony Digital Camera can play?

    Read the article

  • Get variable name as string in Perl

    - by Jose Cuervo
    Hi, I am trying to get a text representation of a variable's name. For instance, this would be the function I am looking for: $abc = '123'; $var_name = &get_var_name($abc); #returns '$abc' I want this because I am trying to write a debug function that recursively outputs the contents of a passed variable, I want it to output the variable's name before hand so if I call this debug function 100 times in succession there will be no confusion as to which variable I am looking at in the output. I have heard of Data::Dumper and am not a fan. If someone can tell me how to if it's possible get a string of a variable's name, that would be great. Thanks!

    Read the article

  • help with jquery ajax and templates in asp.net mvc

    - by NachoF
    So I have a complex form for an IncomeDeclaration. Its going to display a textfield GrossIncome for each Activity that the IncomeDeclaration is related to... this all gets done on the server and works just fine.... the problem is. The User should also be able to add Activities on the fly.. through javascript... so when the user clicks on Add Activity a Dropdown and a textfield must be appended to the bottom the activities list... heres what Ive got so far <tbody id="activities"> @Html.EditorFor(model => model.income.EconomicActivityIncomeDeclarations) </tbody> </table> <a href="#" id="add_activity">Agregar Otra Actividad</a> </fieldset> <script type="text/javascript"> $("#add_activity").click(function () { $.getJSON('/IncomeDeclarations/GetEconomicActivities', function (data) { var select = new Select(); var data = new Array(); for (var i = 0; i < data.length; i++) { var option = new Option(data[i]["name"], data[i]["i"]) //should do something here } //should call the template and append to #activities }); }); </script> <script id="template" type="text/x-jquery-tmpl"> <tr> <td><select name="income.EconomicActivityIncomeDeclarations[${SomeNumber}].EconomicActivityId"> ${MyOptions} </select></td> <td><input type="text" name="income.EconomicActivityIncomeDeclarations[${SomeNumber}].GrossIncome" /></td>> </tr> </script> } The name attribute for both the select and the text_field is key for this to work... otherwise modelbinding wont work... I would think that if the SomeNumber variable is set to new Date.GetTime() model Binding should work just fine... I actually dont see the need of ajax for this but thats another topic.. I just havent figured out a way to do this without ajax... right now I want to get the template to work and append the form elements to the bottom of the list.

    Read the article

  • Reading data from an Entity Framework data model through a WCF Data Service

    - by nikolaosk
    This is going to be the fourth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here and the third one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . Microsoft with .Net 3.0 Framework, introduced WCF. WCF is Microsoft's...(read more)

    Read the article

  • INETA NorAm Component Code Challenge

    - by Chris Williams
    Want to win a trip to TechEd 2011? INETA NorAm is hosting a contest with our partners to see who can build an .NET application making effective use of reusable components to solve a problem. The Rules: Any .NET Application (WinForms, ASP.NET, WPF, Silverlight, Windows Phone 7, etc.) built in the last year (since 1/1/2010) using at least 1 component from at least 1 approved vendor. Then make a 3 - 5 minute Camtasia video showing your entry and describing what component(s) you used and why your application is cool. Our judges will review the submissions and the best two will win a scholarship to Tech·Ed 2011, May 16-19 in Atlanta GA including airfare, hotel, and conference pass. The Judging: Entries will be judged on four criteria: Effective use of a component to solve a problem/display data Innovative use of components Impact using components (i.e. reduction in lines of code written, increased productivity, etc.) Most creative use of a component. Timeline: Hurry! The submission deadline is March 15, 2011 at Midnight Eastern Standard Time. More information can be found on the INETA Component Code Challenge page: http://ineta.org/CodeChallenge/Default.aspx

    Read the article

  • AD FS 2.0: Troubleshooting Event 364 and ThrowExceptionForHRInternal / NullReferenceException

    - by Shawn Cicoria
    Ran into a situation today where after AD FS federation server was installed, configured and up & running, “all of a sudden” it stopped working. Turned out that another installer that affected the default web site, also seemingly affected the AppPools associated to all Applications under the Default Web site. By changing the “Enable 32-bit Applications” either through IIS admin or via command line appcmd set apppool /apppool.name:MyAppPool /enable32BitAppOnWin64:false Back to normal…

    Read the article

  • OCS 2007 R2 User Properties Error Message

    - by BWCA
    When I attempted to configure one of our user’s Meeting settings using the Microsoft Office Communications Server 2007 R2 Administration Tool   I received an Validation failed – Validation failed with HRESULT = 0XC3EC7E02 dialog box error message. I received the same error message when I tried to configure the user’s Telephony and Other settings. Using ADSI Edit, I compared the settings of an user that I had no problems configuring and the user that I had problems configuring.  For the user I had problems configuring, I noticed a trailing space after the last phone number digit for the user’s msRTCSIP-Line attribute. After I removed the trailing space for the attribute and waited for Active Directory replication to complete, I was able to configure the user’s Meeting settings (and Telephony/Other settings) without any problems. If you get the error message, check your user’s msRTCSIP-xxxxx attributes in Active Directory using ADSI Edit for any trailing spaces, typos, or any other mistakes.

    Read the article

  • How to add a permanent redirect (301) for an htm file in IIS 7

    - by bconlon
    Looking in Web Analytics I could see several external sites pointing at an old .htm file on my web server that no longer existed, so I thought I would get IIS to redirect to the new .aspx replacement. How hard could it be? This has annoyed me for quite a while today so here is the answer. 1. Install the Http Redirection module - this is not installed by default!! Windows 7 Start->Control Panel->Programs and Features->Turn Windows Features on or off. Internet Information Services->World Wide Web Services->Common Http Features->HTTP Redirection. Windows Server 2008 Start->Administrative Tools->Server Manager. Roles->Web Server (IIS). Role Services->Add Role Services. Common Http Features->HTTP Redirection. 2. Edit your web.config file <configuration>     .....     <location path="oldfile.htm">         <system.webServer>             <httpRedirect enabled="true" destination="/newfile.aspx" exactDestination="true" childOnly="true" httpResponseStatus="Permanent" />         </system.webServer>     </location>     ..... </configuration> When a user clicks or Google crawls ‘oldfile.htm’ it will get a permanent redirect to ‘/newfile.aspx’ - and should take any Page Rank to the new file.  #

    Read the article

  • MSFT new trick to promote IE9 by kill IE6 first.

    - by anirudha
    Every developer know every issue on development for IE6 whenever they know things more. they are frustrated whenever they spent time in IE6 for making application cross browser compatible. not long time ago MSFT make a campaign save IE6 you can find the reference http://blogs.msdn.com/b/anna/archive/2009/04/01/save-internet-explorer-6.aspx and the webstite is here http://www.saveie6.com/ well they really make joke see what they write on the page. well why website maked in PHP whenever they can make them in asp.net or any other technology who reflect the Microsoft technology see here  http://www.saveie6.com/compare.php High security (many updates) :- you can find IE6 is how much secure you can also read Wikipedia for know. well i can say IE6 is very easily to hack. wikipedia tell you about that here http://en.wikipedia.org/wiki/Internet_Explorer_6 and for know about the security watch here http://www.google.co.in/webhp?hl=en#sclient=psy&hl=en&site=webhp&q=ie6+security+issues Lightweight (no support for silly PNG transparency, etc) :- well they tell PNG silly but tell me about the best format on internet. their is no better option as png or SVG. More screen space thanks to no tabs:-  they tell this nonsense without think anything. if they really care about more screen space why they make tab  in 7,8,9. conclusion:- IE team make a research on how to promote IE9 better then they can beat chrome and Firefox. because IE9 not have anything good like customization , plug-in ,add-ons , personas , themes and many other thing like chrome and Firefox provided perhaps IE is outdated thing even everyone their can writing about these days that IE9 have this, have performance better then this… the main problem in IE is IE6. many developer hate them because many of their time goes for making site cross browser compatible. in 2009 they still have no blah like IE9 who they have today so they make a campaign for save IE6. the list they make is a joke. they show that everything in IE6 is perfect even everyone know the truth. they listed IE6 is high security. in 2011 their is a problem for IE9 promotion called IE6. because developer hate IE6 how they can promote IE9 very well. so destroy IE6 is only option for IE9 make promote better. so you can see they make two different different campaign and both are opposite of other. well  how we can believe in IE9. thanks for reading this post. what you thinking on it. have a idea or feedback reported them.

    Read the article

  • MVC: Nasty __o not declared

    - by xamlnotes
    I ran into this little error with MVC where a bunch of errors showed up about  __o  not declared. This was driving me nuts. Then I ran across this link that solved it. http://stackoverflow.com/questions/750902/how-do-i-get-rid-of-o-is-not-declared So, the solution is to put this into the top of the page like VS does for your site.master. <%-- The following line works around an ASP.NET compiler warning --%> <%: ""%> But what about other pages? Lets say you have a view that’s using your site master and that view is throwing this error. Just add the items into the content section where the error occurs like so: <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <%-- The following line works around an ASP.NET compiler warning --%> <%: ""%>   Then add the rest of your code. That seems to fix it and its pretty simple too.

    Read the article

  • Checking for DBNull

    - by Jim Lahman
    Using a table adapter to a SQL Server database table that returns a NULL record.  We determine the fields are NULL by comparing against System.DBNull Looking the NULL records in SQL Management studio   Using a table adapter to retrieve a record   1: try 2: { 3: this.vTrackingTableAdapter.FillByTrkZone(this.dsL1Write.vTracking, iTrkZone); 4: } 5: catch (Exception ex) 6: { 7: sLogMessage = String 8: .Format("Error getting coil number from tracking table at {0} - {1}", 9: sTrkName, 10: ex.Message); 11: throw new CannotReadTrackingTableException(sLogMessage); 12: }   Looking at the record as it returned from the table adapter:   ItemArrayObject Column [0] ChargeCoilNumber [1] HeadWeldZone [2] TailWeldZone [3] ZoneLen [4] ZoneCoilLen [5] Confirmed [6] Validated [7] EntryWidth [8] EntryThickness   Since each item in the ItemArray is an object, we can test for null   1: if (dsL1Write.vTracking.Rows[0].ItemArray[0] == System.DBNull.Value) 2: { 3: throw new NoCoilAtPORException("NULL coil found at tracking zone " + sTrkName); 4: }   If no records were returned by the table adapter 1: if (dsL1Write.vTracking.Rows.Count == 0) 2: { 3: throw new NoCoilAtPORException("No coils found at tracking zone " + sTrkName); 4: }

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >