Alexandra5's Q&A profile
Visual Studio 2008 (Pre-release) Create new instance of Database all the time, or keep around?
With the access to the underlying data store being abstracted and relatively hidden from us, I find myself wondering how to manage connection pooling and scalability. I have a static utility class that provides all the methods that generate queries. At the moment, it creates a singleton instance of the Database class (e.g. MyDatabase() , the one created by Sqlmetal) (this is for LINQ to SQL, not EF). Should I be creating and disposing of the database instance within each data request method, or should I be trying to maintain the reference to the static instance of the db My gut instinct tells me to do something like this : public static List<MyData> GetSomething(params) { using (Database db = new Database()) { var x = from .... ...Show All
.NET Development how to create .ico file?
Hi, it seems with visual studio 2005, we can create .ico files as required. However, I do not know how to realize that. A very very simple question... Any help Thank you that is exactly what I was looking for. ...Show All
Visual Studio Express Editions Invalid Column Name
Hello, I am using Visual C# 2005 Express Edition and I am trying to connect to an SQL database. I have created the database with the following columns: id, first, last, phone, date I have created a binding source with a Data Grid View and I am trying to load the data. However, I am getting an "Invalid Column Name" error for NO apparent reason. Here is what my code looks like: SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\dsAllMembers.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"); con.Open(); if (con.State == ConnectionState.Open) { System.Console.WriteLine("So far, so good."); SqlCommand command = new SqlCommand("SELECT id, first, last, phone, date FROM tblMemb ...Show All
SQL Server page number & records number
1. how to show page number & total page number in report body 2. how to show total records number thanks for reply, but errors found. for #1: [rsPageNumberInBody] The Value expression for the textbox ‘textbox1’ refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer. for #2: [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox2’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. pls advise, thanks ...Show All
Visual Basic tables/image do not show
I have a strange problem. I have a VB.NET application which was devekoped in Visual Studio. In design view in Studio the tables all appear fine however when I build and view the website the sometimes do not appear. Now if they did not appear every time I would guess itw as something to do with my coding but they fact is they appear sometimes and other times they do not - even thoug I do not change any code. Has anyone come across this problem before or know how to fix it Thanks My code: <% @ Page EnableSessionState ="True" Language ="vb" %> <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or ...Show All
Visual Studio Help with deployment of MS SQL Server 2005 Reporting Services .RDL file
I have a .rdl file which under Ms Studio 2005 which works when I run the preview. I know want to use that RDL in order to render a block of text as HTML as part of an automated program which will generate a bunch of report each by user name in a loop as part of a cron job. The reports would be emailed to each user. The part I need help with is how to render the .RDL report to a block of HTML Which using(s) and reference objects do I need. If anyone has some decent example code of a basic rendering based on a local or web based URL I would greatly appreciate it. I think I should be using: using EmbeddedReport.ReportExecution2005; using System.Web.Services.Protocols; So far I have the following references: Microsoft.ReportViewer. ...Show All
.NET Development serialport
I create a serialport and i add Datareceived event. When a call is coming i use readline function. I see only RING RING RING... I want to get the caller id. When i use HyperTerminal i write at,then at+vcid=1 and the number is displaed when a call is incomning. Also i receve OK when i write this strings in HyperTerminal. In my program i use the functions write and writeline whith the strings AT, AT+VCID=1 but i dont see any "OK" just the strings i wrote. I dont know if i use properly the "write" function to send strings to the com port or is something else that i do wrong. Can you help me with the caller id This is the code in c++ . No problem if you show me something in basic p ...Show All
Internet Explorer Development Css not applying.
i am creating a text area (multi line text box) but its not applying css to it..... any ideas 2ndly i have created a required field validator dynamically and applying the css on it but it is still showing error in default red color. for record css is applying on all other controls on the page. From what I know, you need to have the required field validator on the page as an ASPX control too.. <asp:ValidationSummary DisplayMode="List" ID="err_summary" runat="server" /><br /><br /> <asp:TextBox ID="test" runat="server" TextMode="SingleLine" /> <asp:RequiredFieldValidator ControlToValidate="test" Display="None" ErrorMe ...Show All
Visual C++ problems with DirectX program
My DirectX program doesn't work. It gives me no errors, but if I run it, it gives me errors. What's wrong with it I do not write my mywin.h and basic.h here, because they are not important and work correctly. Procedures from those header files are Logi, MkWin and ReggWin and TPump, so do not be confused of them, just ignore them. My code is here: main.cpp: #define WIN32_LEAN_AND_MEAN #include <D3d9.h> #include "mywin.h" #include "basic.h" #pragma comment ( lib , "User32.lib" ) #pragma comment ( lib , "d3d9.lib" ) WNDPROC wndProc; HINSTANCE hInstance; HWND _hwnd; HRESULT hr; IDirect3D9 *g_D3D=NULL; ...Show All
Windows Forms Graphics Issue
Hi, I'm developing a Windows Forms Application which requires intensive graphics usage. At one point I need to show a grid on a control, which is ofcourse used to arrange controls (much like in the designer of Visual Studio). The problem is that when the grid size becomes small enough, there is a noticeable delay when moving an object. This is obviously because in the Paint event of the control, the grid has to be redrawn every time in order to be visible on the control. All this extra drawing is really unnecessary because once the grid size and location are set, it becomes static. My question is that: Is there a way to save the grid in an image (once it has it's parameters set) and siply draw that image inder the controls I need to ...Show All
.NET Development How can i view shared folders at remote host ?
This variant works only if I had administrative rights on remote host, but I need one to list shares accessible by anonymous user ManagementClass objClass = new ManagementClass( @"\\host\root\cimv2:Win32_Share" ); foreach(ManagementObject objShare in objClass.GetInstances()) { Console.WriteLine(string.Format( "{0} -> {1}" , objShare.Properties[ "Name" ].Value, objShare.Properties[ "Path" ].Value)); } I think there is no way to do this from .Net to get Shares using WMI without the Administrtive Previllages, and I really think that there is merely any thing in WMI which can be done without using Administrative Previvillages. Best Regards, ...Show All
Smart Device Development enabling NE2000 when launching Saved State
Hi I've created an image, without the NE2000 option enabled. Then i want to launch my image and to have the NE2000 option enabled. I use the following command : DeviceEmulator.exe /s \tmp\noNe2000.dess /p 000D56FB2057 or DeviceEmulator.exe /s \tmp\noNe2000.dess /p the image is launched, but the NE2000 option is still not activated. Why If i create an image with the option enabled, selecting my netcard, the NE2000 option will be enabled if i launch the image. My purpose is to create an image that will work on several machines. So i can't bind it to a specific netcard. If i finaly succeed to enable the NE2000 option at the image launch, will the MAC address be the one set by the machine that created the image, or will it be set by the machi ...Show All
SQL Server past and future date
How should I find the dates for 3 days past and 5 days future. Such as TodayDate-3 and TodayDate+5 base in the date only, discarding the time This is likely to be a bit more efficient, since it doesn't require converting from datetime to varchar: SELECT dateadd(day,datediff(day,0,getdate())-3,0) AS [3 Days Ago], dateadd(day,datediff(day,0,getdate())+5,0) AS [5 Days from now] Steve Kass Drew University www.stevekass.com JIM.H.@discussions.microsoft.com wrote: > How should I find the dates for 3 days past and 5 days future. Such as > TodayDate-3 and TodayDate+5 base in the date only, discarding the time > > ...Show All
Visual Studio 2008 (Pre-release) Chart scaling in WPF
Hi together, I have got a chart line (e.g. a sinus) which is presented as a WPF polyline object. Now I have a canvas object where I want to put that line on. canvas1.Children.Add(myPolyline); Now the sinus is shown on the canvas, but only a small (little) curve on the canvas. Is there a way to scale that polyline so that it fits on the whole canvas Do I have to calculate that transformation by myself or is there any support in the WPF. Any help would be great. Cheers, Franz You should be able to simply apply a zoom (scale) transform to the RenderTransform property of either the Shape itself or to an ancestor panel - does this work for you -Adam Smith [MS] ...Show All
.NET Development xml help please.
I want to read only the text in the following xml into an array. Please help. < xml version="1.0" encoding="utf-8" > <precipitatedata> <precipitate> <abrev>TiN</abrev> <fullname>Titanium Nitride</fullname> <firstelement>Titanium</firstelement> <secondelement>Nitrogen</secondelement> </precipitate> <precipitate> <abrev>TiC</abrev> <fullname>Titanium Carbide</fullname> <firstelement>Titanium</firstelement> <secondelement>Carbon</secondelement> </precipitate> </precipitatedata> I want to read like... abrev[1] = TiN abrev[2] = TiC fullname[1]= Titanium Nitride fullnam ...Show All
