Newbie Kam's Q&A profile
Visual Basic DataRelation Many-to-Many
hello. A question please. When I create a One-to-many relation with a datarelation, it works fine. My problem is creating a many-to-many. Could anyone help me Thanks.... Hi Can you confirm the exact nature of the problem you are experiencing and perhaps post the code you use to create the data relation Remember that a many to many is simply a relationship between two fields where neither one contains unique values. Richard ...Show All
SQL Server Programatically setting the sub-report to load
My system uses a variety of invoice templates for each client, so 'Bank A' would have one invoice type sent to it, and 'Bank B' would have another etc. Each invoice template is a report, and they can vary quite substantially. Each month the accounts team need to print out all the invoices for a month. I would like to create a report which has the invoices as a sub-report, so they can all be exported together and printed together. However each sub-report could obviously be a different invoice-template. I notice that the sub-report selector field is one of the only fields that doesn't take an expression. Is there a way to programatically set which sub-report is used   ...Show All
Gadgets [Q:] Event handler for onchange event (old and new value) - how to?
Hi there, I want to write a JavaScript event handler that handles the 'onchange' event of a drop-down list (<select>). This even handler should take different actions based on the old value and the new value of the select. Is that possible What I'm looking for is something like this: <select onchange="eventhandler" /> funciton eventhandler(e) { if (e.oldValue = 1 && e.newValue = 2) { ... } if (e.oldValue = 3 && e.newValue = 2) { ... } } Thanks in advance, Eli Yeah, this is a nice workaround in general case. I was just hoping maybe this is somehow possible probably only for IE Maby using IE behaviors or something ...Show All
Silverlight (formerly WPF/E) WPFE on Office Live
Has WPF/E been tested on Office Live I have added the HTML to a page and IE 7 hangs when I navigate to it: http://charettelabs.com/wpfe.aspx Michael It locks up my IE6 machine as well, only after showing a script error of some sort. I downloaded the code and I will try to run it locally. My guess is that running inside an IFRAME with a deferred script might be messing it up. My guess is that this is an Office Live'ism, but I am not sure. If I find anything interestign in the script i'll let you know here. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Drawing Bitmaps to IDirect3dSurface9
Sorry, the thread in DirectX 101 is wrong Hello, first of all i want to render a video stream to a IDirect3dSurface9 (in the beginning on the primary display device later on a secondary monitor) so at first i'm trying to draw a simple bitmap on the surface... i've created IDirect3d, IDirect3DDevice9 and IDirect3dSurface9 objects... and i've got a window that i've registered and created. It doesn't matter if the bitmap/video is in the window or not. better would be if it were in the window. how can i do it i've tried it this way: pPrimary->BeginScene(); pSurface1->GetDC(&hdc); hdcMem = CreateCompatibleDC(hdc); old = (HBITMAP)SelectObject(hdcMem, hBitmap); GetObject(hBitmap, sizeof(BITMAP), &bm); BOOL ...Show All
Visual Basic how to open a folder
Please, i have been searching about how to open a folder, but i didnt find a thing. I need the code. Well, it was very helpful, thank you, but if u can help me another time check my next thread. it is I wanted to display all the names of files found in "c:\" in a drop down item so i wrote <<< For Each prgmsfound As String In My.Computer.FileSystem.GetFiles("C:\documents and settings\abu al-zooz\my documents\my new toolbar\programmes", FileIO.SearchOption.SearchTopLevelOnly, "*.*") Prgmstsmi.DropDownItems.Add(prgmsfound) Next >>> So when they appear to me they appear in full directory like "C:\anything.exe", but i don't want this i only want "a ...Show All
Visual C# StringBuilder problem!
I have made a StringBuilder sb = new StringBuilder(); But, for each file that exists, a new line (or comma) will be added between each file. IE: if (File.Exists(file)) { sb.Append(fileName); } if (File.Exists(file2)) { sb.Append(fileName2); } But between each file, I need a new line. How can I do this with FOREACH/ Thanks, you could try this: theStringBuilder.Remove(theStringBuilder.Length - 1, 1) There's an easier way: theStringBuilder.Length--; Length is a read/write property. ...Show All
Visual Studio 2008 (Pre-release) SQL2LINQ
Does a tool like this exist Baiscally something to encapsualte all of the complex business rules/logic of the LINQ syntax. Yes. Let's say I have a horrendous SQL Query: SELECT YEAR(date_inserted) AS YEAR, MONTH(date_inserted) AS MONTH, DAY(date_inserted) AS DAY, COUNT(DISTINCT sensor_uid) AS DownSensors FROM dbname.dbo.sensor_status WHERE (priority = 0) GROUP BY YEAR(date_inserted), MONTH(date_inserted), DAY(date_inserted) ORDER BY YEAR(date_inserted) DESC, MONTH(date_inserted) DESC, DAY(date_inserted) DESC It would be very helpful if this could be programatically converted to equivalent LINQ Query syntax. ...Show All
Visual Basic my first DLL: Class is visible but not Functions
I'm learning how to write a DLL in VB Express 2005. It compiles fine: Public Class Common Public Function FourTimes( ByVal x As Long ) As Long FourTimes = x * 4 End Function Public Sub SayHello() MsgBox( "Hello from Pearl4.dll" ) End Sub End Class Then I create a TLB library file, which also appears to work fine: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe C:\Windows\System32\Pearl4.dll /tlb I want to access the functions in VBA, so in Access I added a Reference to the TLB, and now I can see the class named Common, but neither of the two procedures. How do I make them visible Thanks for your help. Henry You'll need to either c ...Show All
Visual C++ Unable to get the new DST changes
Hi, I ran the following code the find the Date/Time as per the new DST rules as of following. I have installed the patch provided for the XP os. #include <iostream> #include <string> #include <time.h> using namespace std; int main() { struct tm* tme; time_t tm; time(&tm); tme = localtime(&tm); tme->tm_hour =1; tme->tm_min =59; tme->tm_sec =0; tme->tm_mday = 11; tme->tm_mon = 2; tme->tm_year = 107; tme->tm_isdst = 1; time_t ticks = mktime(tme); cout <<tme->tm_isdst<<endl; for(int i = 1; i < 65; i++) { ++ticks; tme = localtime(&ticks); cout << ctime(&ticks)<<endl; } return 0; } after MAR 11 2007 1:59:00 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. MouseCursor Component
Here's a component that draws a cursor on the screen where the mouse is currently positioned. It has some events you can handle for button clicks. Still work in progress, but it's functional. Set the texture path property to define what texture the cursor is. Components are great. Just drop this in to your game and boom, you have a mouse cursor (well after you set the texture property). Oh and I assume you have a SpriteBatch already going that you use for drawing other things. If you don't, it's quick to add one yourself. Otherwise, set the Batch property to whatever yours is. using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Components; u ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Humorous but somewhat serious question about XNA
Microsoft has claimed the Nintendo Wii as a "kids toy;" however, if XNA can produce graphics and push performance up to what the Wii is capable of handling (games like Half-Life, Sims 2 from most XNA performance claims), does that mean that XNA is a kids toy too Kid's toy, geek toy, whatever you want to call it. There is no WNA for the Wii or PNA for PS3. I agree XNA is not as capable as pure DirectX/C++, but its not supposed to be. It supposed to be more accessible and faster development, which it is both. I'd love to have a Wii, but I'd love to have all 3 consoles. XNA is about development, making games not playing them. ...Show All
Visual Studio Express Editions what code do i use for key change
ok i have this much i know if gose inbetween this Private Sub Form1_KeyDown( ByVal sender As Object , ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me .KeyDown End Sub but what code is it i use so that is i press the "a" key it will show "y" because you didnt read the code previously carefully ;-) you want the code to execute within the IF statement... If e.KeyCode = System.Windows.Forms.Keys.A Then Me .TextBox1.Text = "y" End If "if condition is true then execute the code" ...Show All
Software Development for Windows Vista QueryInformationJobObject JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
Hello, my question is about calling QueryInformationJobObject to get JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION (JobObjectInfoClass=8) from 32 bit application under 64 bit Windows (XP and server 2003). Function was tested with JobObjectInfoClass=1 and works normally, but with JobObjectInfoClass=8 function always return GetLastError=1 (invalid function). We have tested different parameter length for the pJobObjectInfo parameter and we never get GetLastError=24 as expected and is the case with JobObjectInfoClass=1,2,4,6,9. With JobObjectInfoClass=3 GetLastError=0 ( ) and with JobObjectInfoClass=5 GetLastError=8 in case of wrong cbJobObjectInfoLength. So only for JobObjectInfoClass=8 we get strange result and the function fa ...Show All
SQL Server filegroup auto-growth - know when it happens?
Hey guys, I'm running SQLServer 2000. I am in the process of looking over our current filegroups and providing reports based on file size increases. One thing I'd like to know is when (date and time) a filegroup last "auto-grew". Is there a way to know when this occurs thanks, Jason SQL Profiler, Events, Database... Data File Auto Grow Data File Auto Shrink Log File Auto Grow Log File Auto Shrink ...Show All
