James Thornton ITS IV's Q&A profile
Visual Basic How get the difference of TIME
I have a problem on how to get the difference of time (09:24:00 PM - 09:00:00 PM) Is there any way to solve this Can u help me please:( I am using Visual Basic 2005 for this program, how can i do this You can use either the DateDiff function or the TimeSpan structure. I've included a simple example of each: Dim d As Long d = DateDiff(DateInterval.Minute, #9:00:00 PM#, #9:24:00 PM#) MsgBox( "The difference is " & d.ToSt ...Show All
Windows Forms System.NullReferenceException in RichTextBox while dynamically adding text
Hi, I have a rather strange problem with RichTextBox controls. My form has 2 RichTextBox controls and a TreeView. During the runtime, I'll be writing data to both the RichTextBox controls for every 100 m.sec. During this process after some time, which is not always the same, I get the following exception : System.NullReferenceException: Object reference not set to an  ...Show All
Windows Forms Running Code on Form Load
I am trying to run some code after my form loads, without having to click a button. I have tried the OnLoad event and Activated Event as well as the myForm.Show() method, however, only the outline of the form loads until all the code is done and then it ends. For some reason non eof the child controls on the form load up (just the&n ...Show All
Windows Forms selecting unique keys for datagrid data
I am interested in selecting only certain data in a table to be displayed. I want to display all the data that has the same key int. I want the user to select a name which has a unique Id int, which is passed to the datagrid were it selects all the data which has this unique Id associated with it. Any ideas....help wou ...Show All
Visual Studio Express Editions Searching a data base in visual basic 2005
l need to be able to search for a word or part of a word. as well l need help to code a button to add a record to the data base as well one to delete and one to save. Anyone able to help me with this. it would be most helpful. To search for part of a word use a LIKE clause in your SQL. Have you tried msdn.microsoft.com Sites like www.codeproject.com also have lots of articles on this sort of commonly asked stuff. ...Show All
.NET Development Security.Permissions.SecurityPermission
G'day, I have 2 Win2003 servers, 1 is my database server, 1 runs IIS On the IIS machine I have an ASP.NET 2 application that makes a call to a proprietry 3rd party COM Object/DLL that makes a call to a database on server number 2. When the DLL call is run, I get "Security.Permissions.SecurityPermission" error and thats all it says. If I run the script/dll on the local database server (ie not talking to the database across the network) then it works perfectly, so I know the DLL is good. Does anybody have any idea how I get around this Im a newbie to ASP and have full trust set in the web.config file. Thanks in adva ...Show All
Visual C# MS Access DB for user logon details
Hello everyone, I am having a bit of a problem connecting to a MS Database in C#2005. I have written my app befor as a test bed for the whole programme but I used a simple XML file to strore the username and password details. Now that the application is near compleation I would like to use a MS Access DB for the same purpose. The problem I have is I can connect to the DB in solution explorer and I can creat the DataSet but where do I go from hear. I have tried a few things but none seem to work. Any hints or pointers would be greatly received. With thanks in advance. Scott Hi Scott Be specific, what exactly ...Show All
Windows Forms Changing datagrid values - HELP!!
I have a datagrid (Win forms) and I have added an expression column as follows: DS_Book1.Tables("HaulageBooking").Columns.Add("EstPall", _ Type.GetType("System.Double"), "OrderQuantity / DefaultOPP") The I add column to gridtablestyle: Dim colEstPallets As DataGridTextBoxColumn = New DataGridTextBoxColumn() With colEstPallets &nb ...Show All
Visual Studio Team System Team Build and MSBuild order
Hi, I have a team build type setup that will build several solutions in my team. I have one solutions however that consistantly fails when automatically build using Team Build. It appears that running msbuild on the tfsbuild.proj file that is created somehow calls project targets in the wrong order for this one solution file. If I build the solution file separately (still using the command prompt and msbuild) it is ok, but when build from the tfsbuild file it fails. Looking at the build output, it is clear that the order is wrong, but I can't workout what the order is. It doesn't seems to relate to the sln file!! Can anyone help Regard ...Show All
Visual Basic How Can I create a Sentence from an array in VB.Net?
I need the array to select from several different arrays of words to create a sentence. say array1, array2 and array 3 are some with words, array4 is the final one. dim rand as random dim i as integer dim array4(2) as string dim array1(5) as string dim array2(5) as string dim array3(6) as string i = rand.Next(0 , 5) array4(0) = array1(i) dim rand as random i = rand.Next(0 , 5) array4(1) = array2(i) dim rand as random i = rand.Next(0 , 5) array4(2) = array4(i) dim rand as random i = rand.Next(0 , 5) this will make a random number (i) between 0 and 5, and then pick the word that is at that place in the a ...Show All
Visual C# Socket question.
When I close a socket in the server side, I found the client will receive some empty data automatically, even though I haven't sent anything in my code. I also found that some empty data will also be sent to the server automatically if I close a client side socket. These two cases could be reasonable since there may be some acknowledgement to be sent arround. Upon closing a server side socket by calling its Close(), it's wired to see that ReceiveDataFromClientCallBack() will be called id the socket is a work socket. And the AcceptClientCallBack() will be also be called if the socket is a listner socket. Anybody can explain this W ...Show All
.NET Development Strange behaviour when calling a sql function using SqlCommand
Hi! Have a very strange problem when trying to call a sql function from my .NET code using SqlCommand. In my sql function I'll do a check if a table exists before doing anything else in that function CREATE FUNCTION [dbo].[a_function] ( @param1 int ) RETURNS bit BEGIN IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'<MYTABLE>') AND type in (N'U')) BEGIN RETURN 1 END <more logic> END When I run this function from SQL Management studio's Query tool everything works as expected (The SELECT * ... returns a valid entry), but when I run this code using SqlCommand the SELECT * dosen't returns anyt ...Show All
Visual Basic RC1: "Compiler has encountered a problem..... NEED HELP from MICROSOFT
I do have a rather big VB Windows Project and I get all the time interrupted by a compiler error &Hc0000005&. Have to restart. It happens while I edit the code, two three keys pressed and I get the compiler error. Don't think there is any error in the code itself. It is close to impossible to work with VS anymore. Thanks very much for your help - Thomas Have you taken a look at your event logs I can't help but think there's a hardware problem somewhere. It would sound like either your installation is corrupted which could be due to hardware or there is an ongoing hardware problem. Is other software ...Show All
SQL Server How insert more then 4000 characters?
I need insert many dates from tables to XML file, I use T-SQL, everything is OK, but in one step I can insert maximally 4000 character in uni-code. Is there another way Thanks' a lot. I use such sequence T-SQL: Declare @doc XML , @ixml nvarchar ( 4000 ) SELECT @ixml =( SELECT * FROM SAMPLE "d:SAMPLE" for XML AUTO ) SET @ixml = 'SET @Doc.modify('' declare namespace dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"; declare namespace d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"; insert (' + @ixml + ') into (dfs:myFields/dfs:dataFields)[1] ...Show All
Visual Studio Express Editions Visual Web Developer 2005 Express Edition' - Package Load Failure dialog box appearing.
In addition to installing 'Visual Web Developer 2005 Express Edition', I have installed the Add-In Package 'Microsoft Report Designer'. But when I load 'Visual Web Developer 2005 Express Edition' I get a Package Load Failure dialog box appear. It says 'Package "Microsoft Report Designer" has failed to load properly (GUID = {F3A96850-E2AE-4E00-9278-8FE23F225A0D}), Please contact package vendor for assistance. Application restart is recommended, due to possible environment corruption. Would you like to disable loading this package in the future You may use 'VWDExpress/resetskippkgs' to re-enable package loading.' How can I correct this And ...Show All
