|
I have various ODBC datasources visible in the User DSN and System DSN screens in the ODBC administrator applet. However, although these show fine in the EXCEL data query screen, these data sources don't show up in the choose datasource screen from the add new database choice in vb.net.
What am I missing?
Thanks!
|
|
|
|
|
Ok I was looking at some directx documents that meantion the IntPtr structure. Is this just a pointer? And if so how do you set where it points at and are there any limitation on how you can use it, and is it as fast as pointers? For instance if I said myintptr = myvar would that set myintptr to myvar's value or its location?
thanks for the help,
Mike
|
|
|
|
|
The IntPtr structure is used to handle pointer values in managed code. If you want to set the value of an IntPtr, you have to use the & operator to get a pointer value, but that can only be done in code marked as unsafe.
For regular managed code .NET uses references instead of pointers. They are exactly as fast as pointers, as the final compiled code uses them exactly as pointers.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you guys for your help.
|
|
|
|
|
|
Sir/madam,
can i check the preview of my crystal reports in vb.net 2005
there are labels with information
please help.
Thanks and regards
pankaj garg
|
|
|
|
|
|
Sir/madam,
Can i add the landscape / portrait option in my crystal reports program in vb.net
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
|
Hey there. Printing problem is solved. Thanks anyways
Okay in my previous programs I used to use arrays to hold the entries and information and when the program was to be terminated I used to write back them to a file by using write_ entries () procedure. In this one I want to do now, I don’t want to use this way because of the structure of the program that it follows. I want to save them instantly as the button_save is clicked.
1. Open file ( sr=IO.streamReader)
2. Read till end of file is reached (do while sr.peek <> -1)
3. Now that end of file is reached does the writing (sw.writeline)
But how we can do the writing, we can’t, unless the process of reading to be closed
Which means sr.close() and when it is closed the pointer is set again to beginning.
Writing to file now would be writing instead of the first line again.
How to change the POINTER settings? Sounds silly but i am a newbie to .NET : doh:
How you do the writing then?
↔☻◄ك╦N
|
|
|
|
|
Don't bother opening the file for Read. Just open the StreamWriter for append and anything you write will show up at the end of the file automatically.
Dim sw As StreamWriter = New StreamWriter(filename, True)
The True parameter means "Append" if the file exists.
Documentation on the StreamWriter constructor overloads is here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
sir/madam,
can i check programically before shutting down my computer programically that all the windows are closed(i mean all documents are closed.)
I know how to programically shut down .
Thnaks and regards
Pankaj garg
|
|
|
|
|
You have to check each document to make sure it is closed. You can check if any forms in the application is open.
Use
Application.OpenForms.Count
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
|
The following code describes that we can get the current date and time format of our machine
System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat
can i please get to know how to change the current date time format of our machine
Thanks and Regards
Pankaj garg
|
|
|
|
|
You don't, unless you're writing a system utility. This will change the setting system-wide, immediately affecting all other applications running on the machine at that time and in the future.
Is this really what you want to do?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
you must use Date.Now to get the machine local time
|
|
|
|
|
Sir/Madam,
can i please get to know the basic difference between the parameterfield and parameterfields
Both the classes come under the CrystalDecisions.Shared , the base framework class
Thanks and regards
Pankaj garg
|
|
|
|
|
Like all other classes with an "s" at the end, one usually represents a collection of the other. The ParameterFields class represents a collection of ParameterField objects.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to write a code for automatic shutdown of computer at certain time in VB.NEt . Any pointers ? Thanks in advance
|
|
|
|
|
|
|
I've been messing around with CodeDom lately in an attempt to generate some data handling code for my latest project and run into a problem that has me stumped. It seems that when generating an If statement in VB .NET and calling the IdentityInequality operator you get different results when you would expect the operator to act in a consistent manner.
I have the following snippet of code:
Dim csIfStatement As CodeConditionStatement<br />
Dim csDBNullIfStatement As CodeConditionStatement<br />
<br />
...<br />
<br />
csIfStatement = New CodeConditionStatement(New CodeBinaryOperatorExpression(New CodeVariableReferenceExpression("drData"), CodeBinaryOperatorType.IdentityInequality, New CodePrimitiveExpression(Nothing)))<br />
<br />
For Each row As DataRow In Me._Columns.Rows<br />
strColumnName = row("COLUMN_NAME").ToString()<br />
<br />
csDBNullIfStatement = New CodeConditionStatement(New CodeBinaryOperatorExpression(New CodeMethodInvokeExpression(New CodeVariableReferenceExpression("drData"), "Item", New CodePrimitiveExpression(strColumnName)), CodeBinaryOperatorType.IdentityInequality, New CodePropertyReferenceExpression(New CodeTypeReferenceExpression("DBNull"), "Value")))<br />
<br />
csDBNullIfStatement.TrueStatements.Add(New CodeAssignStatement(New CodeVariableReferenceExpression("_" + strColumnName), New CodeMethodInvokeExpression(New CodeVariableReferenceExpression("drData"), "Item", New CodePrimitiveExpression(strColumnName))))<br />
<br />
csIfStatement.TrueStatements.Add(csDBNullIfStatement)<br />
Next<br />
<br />
cmMethod.Statements.Add(csIfStatement)<br />
<br />
...
Which gives me the following output:
If (Not (drData) Is Nothing) Then<br />
If (drData.Item("JobID") <> DBNull.Value) Then<br />
_JobID = drData.Item("JobID")<br />
End If<br />
End If
When I really want:
If (Not (drData) Is Nothing) Then<br />
If (Not drData.Item("JobID") Is DBNull.Value) Then<br />
_JobID = drData.Item("JobID")<br />
End If<br />
End If
Has anyone been in the same situation or know how I get around this? I'm sure I'm just too much of a noob at this and have missed something very basic.
Thanks
Simon
|
|
|
|
|
I may be wrong here, because I don't write this kind of code, but IIRC, the Is operator is a VB.NET shortcut for comparing the type references of two objects. I think you're missing getting the CodeTypeReference of both operands.
My confidence level on this answer is about 10%, so feel free to ignore this! :->
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave
Thanks for this.
I'll give it a go and see how it reacts, I think I might still have an issue though because when I change the operator from IdentityInEquality to IdentityEquality I do get an Is instead of an =. So the problem just seems to be isolated to the IdentityInEquality operator. I was thinking that it might have something to do with there not being a ValueInequality operator, maybe someone tried to get funky and combine the two with some smarts??
Simon
-- modified at 22:42 Sunday 4th March, 2007
|
|
|
|