levins's Q&A profile
Visual Basic Application Path
Hi , i am new to VB.net windows application. How to get the application path of the application. Thanks in advance http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.startuppath.aspx Best regards, Johan Stenberg ...Show All
Visual C# Newbie question: Passing TextBox value in SQL query
I wrote following code, but it displays an error where I am passing the TextBox value. Please help: ---------------------------- string qFind = "Select * from FamilyType where FNM like '" & textBox1.Text & "%'"; ---------------------------- You are probably passing a string that contains an apostrophe. As a rule, you should not build your queries from strings, always try to use parameters. SqlConnection conn = new SqlConnection (myconnectionstring); SqlCommand cmd = new SqlCommandd ("select * from FamilyType where FNM like @Pattern", conn); cmd.Parameters.AddWithValue ("@Pattern", textBox1.Text + "%"); ... Edit: I just noticed you are joining your values with "&". That's VB... In C# you j ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Render part of an object. + Setting transparancy of a texture.
I have 2 questions, first one: If you have a normal UserControl (No DirectX yet) and paint a box inside it with GDI+, every part of the box that is inside of the Control is visible and everything else is not. I want to acomplish something similar with Direct3d. As you can't use UserControls with direct3d, I've made my own class that contains a Rectangle of where my object should be located. I want everything that this object paint to be visible only inside this rectangle, if half the object is outside i want that part to be invisible and the part that is inside to be visible. R ight now i only do a check if the Boxes is inside the bounds where it should be visible, if it is I render it. But this doesn't look very good b ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Framerate decoupling
I'm trying to decouple the framerate from Update() so i can have more than 60 FPS. I saw this post with private void graphics_ModifyDevice(object sender, ModifyDeviceEventArgs e) { e.GraphicsDeviceInformation.PresentationParameters[0].PresentationInterval = PresentInterval.Immediate; } but couldnt get that to work... any help/ideas I know I'll have to use the ElapsedRealTime in my FPS code but not sure where to put it at. A good way to slow it down is to tie it to your refresh rate ...Show All
Visual C++ Separator in a context menu
Hi all, How do I add and locate a separator in a context menu (of the mouse right button ) E.g. I wish to separate (between two lines) my own menu items (in the context menu) from all the others. Best regards. Sorry, I forgot to mention that Im working with C++ and it is an automation project which adds these menu items to the context menu of ms-word . The insertion of menu items is done by late-binding . Thanks for your help, ..., but the provided solution does not work :-( If you have some more ideas it will be great. Thanks in advanced and best regards. ...Show All
Community Chat HAY! I'm not sure what is allowed in here
Serious Question.. I DID look for what I should do but.... Gee I spent two days gettin' nowhere! Can code be posted in here for other's use Do I need to send 'AS MADE' or erase all DLL and Exe files first I would suppose if OK in a ZIP I have some programs made with my FREE C# Express (I LOVE FREE) Thank you Bill! Ya' made me SO happy! Just some test programs with User Controls for the Mindstorms(tm) NXT... using my wonderfull! C# Express.. And Other (Smarter than I am) code which I think is is free to anybody.... Sorry folks.. I tried the Microsoft (tm) Robo stuff but I'm not smart enough to use it! EDIT: Sorry LEGO Mindstorms (tm) not the other NXT! Yes, you can post code here for others to use. If yo ...Show All
.NET Development What's wrong with this XML construction
I'm trying to upload data from a PDA data store to a remote server, and am writing an XML document to transmit the data. The data is stored in two tables, a transaction summary for each transaction, product level details for that purchase. I transmit multiple transactions at a time. The XML I'm creating for each transaction looks OK, but when I try to append this node to the document, it fails with an 'Invalid ChildType' error. I create my XML by first creating the document ( xdoc ) doing the minimum initialization, then making repeated calls to xdoc.CreateNode(.. ). It has always bothered me that I create a node at the document level but then add it to a child node, but I've never had problems with it. Any help is greatly appreci ...Show All
Visual Studio Express Editions Long Delays when accessing files
Anytime I attempt to retrieve a file, or save one, VB2005 Express first does a real long access to to net, sometimes it's so resource intensive it freezes my computer, then eventually alows me to continue navigating to the file. If I disable my network adapter it acts normally. What is ittking for and how do I make it stop. Hmm, I've seen this behavior on networked PCs in a workgroup. Windows XP often has trouble locating a PC by name, even if the network share is mapped to a drive. I think it has something to do with none of the PCs volunteering to become the "master browser"; XP takes a long time to make up its mind where the PC might be located. I got rid of all this misery by giving all the P ...Show All
Software Development for Windows Vista .NET 3.0 and wsFederationHttpBinding changes???
I am working through Security Token Service Samples Walkthrough for September 2005 Community Technology Preview and trying to adapt it to CTP June. What is the new configuration supposed to look like for the following chunk I took from my service sample's web.config <bindings> <wsFederationHttpBinding> <binding name='helloFederatedBinding' > <security mode='Message'> <message> <claims> <clear /> <add claimType='http://schemas.microsoft.com/ws/2005/05/identity/claims/emailaddress' /> </claims> </message> </security> </binding> </wsFederationHttpBinding> </bindings> I get the foll ...Show All
Visual C# How to retrieve export information from unmanaged dll?
Is there exists any tool that can extract marshal information about all exported cpp-functions from unmanaged dll For example: someexptool.exe unmanaged.dll managedwrapper.cs someexptool.exe crypt32.dll crypt32.cs in crypt32.cs we could find something like : [ DllImport ( "crypt32.dll" , SetLastError = true )] public static extern bool CryptMsgUpdate( IntPtr hCryptMsg, byte [] pbData, int cbData, bool fFinal); [ DllImport ( "crypt32.dll" , SetLastError = true )] public static extern bool CryptMsgClose( IntPtr hCryptMsg); and so on. I have many little problems with extracting marshal information from unmanaged dll. I hope there is exists a tool to automate this p ...Show All
SQL Server Web Replication From SQL 2005 Express
I have tried to setup Web replication following the instructions in the articles in SQL Books Online, using RMO. I am able to create the subscription, but when I try to sync it I get the following error. The process could not create file 'C:\DOCUME~1\lsimpson\LOCALS~1\Temp\HNTBW115D$B_borings_BoringsAll_C:\BORINGS\BORINGDB.MDF\' due to OS error 123. Is anyone familiar with this error If I can solve it, I think the replication will work. I changed the database name to BoringDB and that fixed the original problem. I was able to create a subscription using SSMS and sync it. I am getting a new error when I try to sync with code. I will open a new thread if I can't solve it. Thanks for your help. ...Show All
Visual C# Calling Event Issues??? Help!
When my form closes I want to fire an event that will do somethings....but i think i may be calling it wrong...Here is my method signiture...and this is the error.... [code languge="C#"] public delegate void frmClosing ( object sender, FormClosingEventArgs e); public frmClosing ClosingVendorDetails; public static void DisplayVendorDetails(System.Windows.Forms. Form ParentForm, BHFreight.Tracking.BusinessObjects. VendorOrderLegDetail _VendorLeg, frmClosing ClosingForm) { BHFreight.Tracking.UI.MainWindows. VendorOrderLegDetailsForm frmVendorLeg = new VendorOrderLegDetailsForm (); frmVendorLeg._VendorDetail = _VendorLeg; frmVendorLeg.LoadVendorObjectToForm(); frmVendorLeg.ShowDi ...Show All
SQL Server Questions about reportBuilder
Hi ! We have made a webApplication that use ReportServer. Some of our client would like to be able to make some basic report. They can't use Visual Studio so i thought that reportBuilder will be a good idea. I've tried to create a Model for them but it doesn't work. I have followed the instruction on this page: http://msdn2.microsoft.com/en-US/library/ms345313.aspx I have created my datasource. When i click on Generate and put the name for the model i click on OK and then i always got this error: (rsModelGenerationError) A relation already exists for these child columns. Did i forget something to do Also i would like to know how to do to install ReportBuilder on a Client computer. Those client already have a server wi ...Show All
Visual Basic Class Question
I am tryin to create a login in Form when a user enters his name in a textbox it shows a message box saying that this name is in the database....I am not sure how i should access the property that is assigned to the SqlDataReader.GetValue(2).toString() here is my class Imports System Imports System.Data.SqlClient Public Class DataForm Private fname As String Private lname As String Public Property d_fname() As String Get Return fname End Get Set ( ByVal value As String ) fname = value End Set End Property Public Property d_lname() As String Get Return lname End Get Set ( ByVal value As String ) lname = value ...Show All
Windows Forms Displaying Database information in ListView
I created an address like database with first and last names and include a photo location in the database. Now I want to use ListView to display the photo and name of each row(person) in my database, but I don't know how to retrieve a string from a single cell in my database. can anyone help ok you are using VB.NET so.... Me.ListView1.DataBinding.Add(ListView1, Firstdatabasedataset.Tables(0), "FirstName") I still think this will not work, due to the first parameter - it expect a string property name, not an object. However at this stage I am unsure what the parameter should be. The other alternative is the way I had suggested earlier - go through each row and get the current row columns' cell value ...Show All
