Daily Archives

Articles indexed Thursday June 3 2010

Page 25/111 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Odd Profiler Results with EF4

    - by AjarnMark
    I have been doing some testing of using the Microsoft Entity Framework 4 with stored procedures and ran across some really odd results in SQL Server Profiler. The application that is running which uses Entity Framework 4 is a simple Web Application written in C#, and the Entity Data Model is actually contained in a referenced class library of its own.  I’ll write more about my experiences with this later.  For now the question is, why does SQL Profiler think that the stored procedure is running in Master, and not in my application database? While analyzing the effects of using custom helper methods on my EDM classes to call the stored procedure, I decided to run Profiler while I stepped through the code so that I had a clear understanding of exactly when and what calls were made to the SQL Server.  I ran Profiler switching back and forth between the TSQL and TSQL_SP templates.  However, to reduce the amount of results rows I needed to wade through, I set a filter on DatabaseID to be equal to my application’s database.  Each time I ran this, the only thing that I saw was an Audit:Login to the database, but no procedure or T-SQL statements executed, yet I was definitely getting results back to my web page.  I tried other Profiler templates, still filtering on DatabaseID (tangent: I found, at least back in SQL 2000 Profiler, that filtering on DatabaseID was more reliable than filtering on DatabaseName.  Even though I’m now running SQL 2008, that habit sticks with me).  Still no results other than the Login.  Very weird! Finally, I decided to run Profiler with no filtering and discovered that that lines which represent my stored procedure and its T-SQL commands are all marked with DatabaseID = 1, which is Master.  Why in the world would that be?  My procedure is definitely in the application database, and not in Master, and there is nothing funny about the call to the procedure evident in Profiler (i.e. it is not called as MyAppDB.dbo.MyProcName, but rather just dbo.MyProcName).  There must be something funny with the way the Entity Framework is wrapping this call, and I don’t like it…I don’t like it one bit.  My primary PROD server contains 40+ databases on it, and when I need to profile something, I expect to be able to filter based on DatabaseID (for the record, I displayed DatabaseName in my results, too, and it also shows Master). I find the same pattern of everything except the Login showing up as being in Master when I run my version that uses standard LINQ to Entities instead of stored procedures, so that suggests it is not my code, but rather something funny with SQL Server 2008 Profiler or the Entity Framework. If you have any ideas about why this might be so, please comment below.

    Read the article

  • I need some help optimizing my database schema

    - by Steffan
    Here's a layout of my data: Heading 1: Sub heading Sub heading Sub heading Sub heading Sub heading Heading 2: Sub heading Sub heading Sub heading Sub heading Sub heading Heading 3: Sub heading Sub heading Sub heading Sub heading Sub heading Heading 4: Sub heading Sub heading Sub heading Sub heading Sub heading Heading 5: Sub heading Sub heading Sub heading Sub heading Sub heading These headings need to have a 'Completion Status' boolean value which gets linked to a user Id. Currently, this is how my table looks: id | userID | field_1 | field_2 | field_3 | field_4 | etc... ----------------------------------------------------------------------- 1 | 1 | 0 | 0 | 1 | 0 | ----------------------------------------------------------------------- 2 | 2 | 1 | 0 | 1 | 1 | Each field represents one Sub Heading. Having this many columns in my table looks awfully inefficient... How can I go about optimizing this? I can't think of any way to neaten it up :/

    Read the article

  • Pointers in c/c++

    - by jammkie same
    include void main() { int p[]={0,1,2,3,4}; int *a[]={p,p+1,p+2,p+3,p+4}; printf("%u %u %u %u",a,a,(*a)); } What should be the output of the above code? And if we make array p as static(static int p[]), output gets changed .Why?

    Read the article

  • Is it possible to join these two regex expressions into one?

    - by Pure.Krome
    Hi folks, i have the following two regular expressions (in order btw). 1. ^~/buying/(.*)\?(.*) => foo= group 1 baa= group 2. 2. ^~/buying/(.*) => foo= group 1 baa= nothing/empty/null/baibai What's i'm trying to do is, if the url has a questionmark, then split it into two groups. Otherwise, just throw all the stuff into the first group. the reason why the order is important for me, is that if i switch them round, the '?' regex will never get fired because the #2 expression (above) will catch all. So .. can this be re-fixed? NOTE: I have tried using this website** to help me debug/tweak .. but I can't figure it out. ** I have no affiliation with that site.

    Read the article

  • Working smaple mpoauthconnection for iphone

    - by Ameya
    Has any one got a working code sample for mpoauthconnection. I had checkout source from code.google.com/p/mpoauthconnectio. But selecting MPAouthTestApp gives the following error. target specifies product type 'com.apple.product-type.framework', but there's no such product type for the 'iphonesimulator' platform Please help me to solve the error or can anyone provide me with a sample working code for mpoauthconnection. My email id is [email protected]

    Read the article

  • Using getRotationMatrix and getOrientation in Android 2.1

    - by aaronmar
    I've been having issues with this for far too long. This code should output dx,dy,dz for the accelerometer, and a running total of the dx. It should also output azimuth, pitch, and roll. I've used info from http://bit.ly/codeUsed, but to no avail. This code does not correctly output pitch, azimuth, or roll. It outputs 0.0, -0.0, -0.0 for the last three textviews, respectively. Please restore my sanity by helping me switch (event.sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: accelerometerValues = event.values.clone(); case Sensor.TYPE_MAGNETIC_FIELD: geomagneticMatrix = event.values.clone(); sensorReady = true; break; default: break; } if (geomagneticMatrix != null && accelerometerValues != null && sensorReady) { sensorReady = false; float[] R = new float[16]; float[] I = new float[16]; SensorManager.getRotationMatrix(R, I, accelerometerValues, geomagneticMatrix); float[] actual_orientation = new float[3]; SensorManager.getOrientation(R, actual_orientation); tvXCoordinate.setText(accelerometerValues[0] + ""); tvYCoordinate.setText(accelerometerValues[1] + ""); tvZCoordinate.setText(accelerometerValues[2] + ""); floatXTotal += accelerometerValues[0]; tvXTotal.setText(floatXTotal + ""); tvAzimuth.setText(actual_orientation[0] + ""); tvPitch.setText(actual_orientation[1] + ""); tvRoll.setText(actual_orientation[2] + ""); }

    Read the article

  • payment order option for payment in oscommerece

    - by manish
    Hello sir... I need PAYMENY ORDER for making payment.when customer choose payment with payment order, then he have to fill a form and submit .For oscommerece i need thid. Means,When the user reaches the page where payment information is requested we will have a option to pay using Purchase Order in the dropdown and credit card information will not be asked in this case. They will need to fill out all the information like this page https://creator.zoho.com/dmkosanke/form/7.Once this is filled an email alert will be sent and this application will show up under admin and they can check and approve it.

    Read the article

  • How to make script paths inside user control independent of page hierarchy.

    - by Rohit
    My website is organized in the following folder structure Root Pages CustomerManagement DepartMentManagement Script UserControls Now i have a user control inside userControl Folder. I have to use a external js file. So i use it this way <script type="text/javascript" language="javascript" src="../Script/slider.js"></script> My understanding is that since both are under root so i have used a single .. Now what happens is that when this usercontrol is used inside DepartMentManagement it checks for script folder inside CustomerManagement as .. refers to one hierarchy above and script file is not found.Even using a ~ doesnot work. I want to make this script path independent of the path where this control is used. I don't want to move script reference code to the page as control requires script mot page.Please tell me how to achieve this.

    Read the article

  • Empty constructor or no constructor

    - by Ram
    Hi, I think it is not mandatory to have a default constructor in a class (C#). So in that situation shall I have a empty constructor in the class or I can skip it? Is it a best practice to have a default empty constructor? Class test { test() { } ...... } or Class test { ...... }

    Read the article

  • Problem creating XML using c#

    - by Pankaj
    I am searching a batter solution for creating xml through xml serialization. What i need, i have a given format like this <product Id="1"> <name>2 1/2 X 6 PVC NIPPLE TOE SCH 80</name> <notes> <note>!--note 1---</note> <note>!--note 2--</note> ...... </notes> </product> what i am doing here, i created a 2 classes like this public class product { [XmlElement("name")] public string Name { get; set; } [XmlArray("notes")] public List<notes> ListNotes { get; set; } } public class notes { [XmlIgnore] public string Note { get; set; } } when i am serializing this then i am getting xml in this formate <product Id="1"> <name>2 1/2 X 6 PVC NIPPLE TOE SCH 80</name> <notes> <notes> <note>!--note 1---</note> <note>!--note 2--</note> </notes> </notes> </product> i don't want extra <notes>. Any batter solution to solve this problem? Thanks

    Read the article

  • how to pass parameters to a URL and get the generated image

    - by Nubkadiya
    i want o pass several parameters to this url and generate the map from it and show it in my java application. i know the code to download the image and show it in the java application. i want to know how to pass parameters to this address "http://maps.google.com/maps/api/staticmap?center=Nugegoda&zoom=14&size=1000x312&maptype=roadmap&markers=color:blue|label:S|size=tiny|Mirihana\&markers=size:mid|color:0xFFFF00|label:C|Udahamulla&sensor=false " in this link Nugegoda and Mirihana and Udahamulla is the one that i should pass from the application. and then it will generate a image and i do need to show it. even if u check this link. its a image. can someone help me

    Read the article

  • use java-ffmpeg wrapper, or simply use java runtime to execute ffmpeg?

    - by user156153
    I'm pretty new to Java, need to write a program that listen to video conversion instructions and convert the video once an new instruction arrives (instructions is stored in Amazon SQS, but it's irrelevant to my question) I'm facing a choice, either use Java RunTime to exec 'ffmpeg' conversion (like from command line), or I can use a ffmpeg wrapper written inJava http://fmj-sf.net/ffmpeg-java/getting%5Fstarted.php I'd much prefer using Java Runtime to exec ffmpeg directly, and avoid using java-ffmpeg wrapper as I have to learn the library. so my question is are there any benefits using java-ffmpeg wrapper over exec ffmpeg directly using Runtime? I don't need ffmpeg to play videos, just convert videos Thanks

    Read the article

  • validates_associated not honoring :if

    - by James Ferguson
    I'm totally blocked on this. See this pastie for sample code: http://pastie.org/990040 The first test will fail. The user model validates an associated address model, but is only supposed to do it if a flag is true. In practice it does it all the time. What is going on?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >