|
|
What is the correct syntax in a .NET SQL INSERT or UPDATE command which will create a NULL in an integer field in Microsft Access?
Note: because I already do this in other parts of my code through use of datasets and "DBNull.Value", I not only know that it is possible, I can also write a cumbersome work-around using these.
But I believe that some simple way can be found to do this using "OleDbCommand(sql, connection)" and the appropriate string for "sql".
I've tried 'null', nothing, DBNull.Value and several othersin my "sql" string. All give me syntax errors as the code attempts to update the database.
Thanks, Jimbeau
|
|
|
|
|
.NET Framework Class Library
SqlInt32.Null Field
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqltypessqlint32classnulltopic.asp
|
|
|
|
|
Hi All!
Sorry for the cryptic explanation that follows!
My problem is :
i have created a gradient on a form, and then I have put a custom control that i created that just basically implements a picturebox control.
The control is a checkbox control that uses graphics that i made in photoshop, saved as a png file, which incorperates transparency.
The problem is that my control doesnt maintain transparency over this freshly
created GDI+ gradient, however if i was to put the control over a picture say in a picture box that i had loaded from file then it works!
When i do it over the GDI+ stuff, i see a (grey windows default coloured) box around my Checkbox!
If that lot makes any sense to any one i would appr. any help anyone can offer!
Thanks for your help!
|
|
|
|
|
Does anyone know how to lock the keyboard and mouse?
I have a sensitive part in my code where I do not want the user to be able to do anything with the keyboard, not just in my application - nothing at all!
Just for a few seconds I want to lock the keyboard and mouse.
Thanks,
Haim.
|
|
|
|
|
This is definately NOT a good idea! Unless your application is doing something in realtime, like high resolution data sampling, there is no good reason to do this.
But...
You'll have to write a keyboard hook and a mouse hook to "disable" them. There is no API call you can make. In VB.NET you could also just write a couple of Message Filters and add them using Application.AddMessageFilter , the docs are here[^] on MSDN. You would have to filter ALL the keyboard and mouse messages.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
However, after posting my question I did find a way to do it, and after getting a lot of answers like yours I decided to write the following article:
http://www.codeproject.com/useritems/LockKeyboard.asp
Thanks again,
Haim.
|
|
|
|
|
I didn't say it was impossible, just a bad idea! This is something you must be VERY careful to do. I for one, would NOT want my keyboard and mouse disabled for 20 seconds while I go off and do other things while this process is busy performing a long operation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I know there must be a way around this problem I am having, but for the life of me, I cannot find it.
We are currently programming applications in VB.NET, trying to implement Visual Source Safe 6.0.
Our problem, is that we use a large ammount of custom controls and other classes which are shared among various application we are building. How do we get this righ using Source Safe? In essence we need to be able to add solutions to source safe, which in turn can be referenced by any other number of solutions, also kept in source safe.
Please help.
Thanks.
|
|
|
|
|
We had a similar problem, It may be of some help to u,
u can create add the common project to ur existing soln and
put it vss. so that when u get the soln to ur local copy
u get both the projects along.
(In our case the no of projects were less so we got away with this)
cool man
|
|
|
|
|
Hi all,
Is this possible to display a windows form from a remotable object?
I need to create a singlecall server application that gives access to an instance of MapPoint ActiveX control to its clients. And I also would like to display a form from the remotable object containing the ActiveX, so I can see the actual maps being retrieved by the remote clients (for debugging purposes).
In a sense I need to create an Automation-enabled app, so that I can interact with it programmatically or via user interface at the same time. Is this possible with .NET remoting?
Thank you for your input.
Alex
|
|
|
|
|
hi there!please help me with this..we get the data from the TSD(test system directory) and these relaymon data have relaycounts. what im doing is i summed up the relaycounts using the pivot table(in excel).after it summed up,the pivoted data shows.the data(relay monitoring data) have their equivalent relaycode, and these were save in another worksheet.what im trying to do is to get that equivalent relaycode in the worksheet where the pivoted datas are.how will i do that?i couldn't used of select case statement because there are thousands of datas in TSD.each day it has thousands of datas saved.so how am i supposed to do that?pls help me..need asap...tnx a lot!
|
|
|
|
|
i want to record clips using a web cam in vb.net code
can any body help me please on this
if possible send me code on this which will be handy
thanx in advance
i am a sr: Software Engg
|
|
|
|
|
Hi there,
I have been trying to get to read from one DB into a dataset. Then read from the dataset into an XML file and then read from the XML file into a second dataset. Now all of this I got right but the part where I update the DB (a different one to the original) is not working. I am not getting any errors but the table stays empty.
I prosume that the problem is the same as mentioned by Ami but I would appreciate any comments or help regarding this. Below I have included the part of my code that does this.
Kind regards!
Etienne
Dim myAdapter As New SqlClient.SqlDataAdapter
Dim myAdapterLocal As New SqlClient.SqlDataAdapter
Dim objData As New ExtITPOSData.Data
Dim myConnServer As New System.Data.SqlClient.SqlConnection(objData.GetConnectionString)
Dim myConnLocal As New System.Data.SqlClient.SqlConnection(objData.GetLocalConnectionString)
Dim dsServer As New dsSyncronization
Dim dsLocal As New dsSyncronization
'--put data into dataset
myAdapter = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnServer)
myAdapter.Fill(dsServer, "Tax")
dsServer.WriteXml("../Tax.xml", XmlWriteMode.DiffGram)
myAdapter = Nothing
dsServer = Nothing
myAdapterLocal = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnLocal)
Try
dsLocal.ReadXml("../Tax.xml", XmlReadMode.DiffGram)
Catch FileNotFound As FileNotFoundException
' The XML data must be written before it can be read
MsgBox("No XML file available. View data online and save to offline.", MsgBoxStyle.Critical)
End Try
Dim myCmdBuilder As New SqlClient.SqlCommandBuilder(myAdapterLocal)
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")
Thanx!
|
|
|
|
|
Cyberclown wrote:
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")
Have you tried checking what SQL the CommandBuilder generated? All you need to do is either stop the program on the .Update statement and look at the InsertCommand property of use
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
Debug.WriteLine("Command Builder generated: " & myAdapterLocal.InsertCommand)
myAdapterLocal.Update(dsLocal, "Tax")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
can someone help me with this
on my machine
obj.SmtpServer = "mailserver" works and
obj.SmtpServer.Insert(0, "mailserver") returns the CDO.Message
on a server running windows server 2003, its the opposite... this is ticking me off since i need to change the code when i try to make it works, any of you guys have an idea?
|
|
|
|
|
CDO.Message is a class, not an error. I take it your getting the "Could not access 'CDO.Message' object."
Every versoin of CDO I can find defines the SMTPServer field as a String . I can't find a single reference to an Insert method for the SMTPServer field or that the field is defined as a colleciton.
But, I'm not saying your lying or don't know what your talking about. What you might want to try is hitting F2 and navigating down the object browser to find the CDO object and the SMTPServer property. There, you'll be able to see if SMTPServer is defined as a string or a collection.
In either case, you'll have to write code that either attempts to get the CDO Version installed on the machine and sets the field using the appropriate method, OR tries setting the SMTPServer field using one method and if that fails (Try/Catch block) tries the other method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks i will try the try/catch method since i dont know how to check the version :/ im still a beginner
|
|
|
|
|
I write a codeDom program.
where i add the following statement to the code:
property1.SetStatements.Add(New CodeAssignStatement(New CodeFieldReferenceExpression(New CodeThisReferenceExpression, strFieldVal1), New CodePropertySetValueReferenceExpression))
the run result is:
Set
MyBase.CurDataRow.Item("CusID") = Value
End Set
It miss the "(ByVal Value As String)" statement.
How can I display this statement?
|
|
|
|
|
|
I need a way to add copy to a listbox when right click is pressed, and using multiple select expanded. TIA
|
|
|
|
|
Has anybody ever noticed that when you right align a column in a datagrid that the last character of the columnheader text is nod displayed properly? I've tried adding spaces at the end of the text but it is trimmed and the same thing is displayed. Anybody know of a workaround?
|
|
|
|
|
Soory - I've had the same problem, and would like a solution too.
Good luck!
Jimbeau
|
|
|
|
|
Hi all,
I have a little problem: by application is generating a report and it takes some time.. so I want to show a little "please wait" always-on-top window while the report is generated.
I created a form with a "Please wait" label and a timer that animates a bitmap every 500 milli. And this is how I call it from my app:
dim frm as new frmWaitMsg
frm.Show
GenerateReport
frm.Close
And it doesn't work! The message form doesn't load properly. I can see the frame, but the CPU doesn't complete the task: the insides of the form are not drawn until the report is complete. So I tried running the report in a seperate thread, but I don't know how to deal with all the yielding problems. I wrote something like:
dim frm as new frmWaitMsg
dim t as new Thread(GenerateReport)
frm.Show
t.Start
t.Join
frm.Close
But then, it looks like the Join blocks my form, and I get the same results
How do I do this?
Thanks,
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
I am having the same problem here. I even tried a fade effect on a timer with the forms opacity to get redraws in a thread and it just draws the frame with a black box inside. Funny enough though, it works perfectly launching from Visual Studio. But it hassles when running standalone.
I use a similar code block to yours, but have also tried at least 5 other approaches.
Any help???
Greg
|
|
|
|