|
Dave Kreskowiak wrote: SQL Server doesn't give a rats ass Sad, but true.
Use the best guess
|
|
|
|
|
I need to update an old project, which has all the files, .vb, .resx, .designer.vb, .dll, .vshost,.exe ... in one folder.
So I wonder if I can create a new project, and create new directory architecture, like: src/UI; src/DAL, src/BLL, Res/icon,
Then copy the files from old project folder to the new folder.
for now, I find I can't use "add existing item" to add .resx to the new project.
Then I try to just create new folders in the old project and move the files to new folder,don't know if this way works or not.
Could anybody give me some advices?
Thanks
modified 26-Mar-13 10:27am.
|
|
|
|
|
Now I know I can rearrange the files into new created folders in old project.
|
|
|
|
|
I tried to use a string var, like aStr & VBC_VER,but the IDE show
error mark on VBC_VER.
I know VBC_VER is a conditional compilation constant, so can I print the constant on console or msgbox()?
modified 26-Mar-13 10:27am.
|
|
|
|
|
econy wrote: error mark on VBC_VER.
It can't be printed like a string, since it's not a variable. Try something like below;
Dim bla As String
#If VBC_VER >= 9.0 Then
bla = "9+"
#Else
bla = "8 or lower"
#End If
Console.WriteLine(bla)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, then it is not possible just output VBC_VER?
like: printf("%s\n", VBC_VER)?
|
|
|
|
|
No.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
No, because the compile-time constants won't exist at run-time. They are not variable, nor are they replacement strings that will show up in your code.
|
|
|
|
|
Good Morning,
I am new to this forum, so hello, world!
I am attempting to read the following from a text file and turn each line into a separate array...
MIA JFK HNL LAX DFW
-5 -5 -10 -8 -6
0 3 12 8 2.5
3 0 14 8.5 3.5
12 12 0 4.5 8.5
8 8.5 4.5 0 3.5
2.5 3.5 8.5 3.5 0
Ideally the first line would be inserted into an array like {MIA,JFK,HNL,LAX,DFW}
Second line a new array with {-4, -4, -10, -7, -5}
And the last lines would be inserted into a two dimensional array:
{{0, 3, 12, 8, 2.5}, _
{3, 0, 14, 8.5, 3.5}, _
{12, 14, 0, 4.5, 8.5}, _
{8, 8.5, 4.5, 0, 3.5}, _
{2.5, 3.5, 8.5, 3.5, 0}}
I have been struggling for over two days with this. This solution is probably easy... but it is evading me. I have tried using the streamreader to no avail.
Here is something I tried...
Public Class Form1
Dim tmpArray() As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim sr As New StreamReader("..\..\info1.txt")
Dim count As Integer = 0
While Not sr.EndOfStream
Dim line As String = Nothing
line = sr.ReadToEnd()
tmpArray() = line.Split(" ")
End While
Catch ex As Exception
End Try
End Sub
End Class
Any help would be greatly appreciated.
|
|
|
|
|
Here you go;
Sub Main()
Dim arrayLines As List(Of String()) = New List(Of String())
For Each line As String In IO.File.ReadAllLines("TextFile1.txt")
arrayLines.Add(line.Split(" "))
Next
Dim theArray As String()() = arrayLines.ToArray()
Console.ReadLine()
End Sub
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I want to implement a function in my program, to judge if the active solution configuration in build configuratioin manger is Debug, or Release.
Can anybody tell me how to do it?
modified 5-Mar-13 11:11am.
|
|
|
|
|
See here[^].
Use the best guess
|
|
|
|
|
Here you go;
Private Enum CompileMode
Debug
Release
End Enum
Private Function GetCompileMode() As CompileMode
#If DEBUG Then
Return CompileMode.Debug
#Else
Return CompileMode.Release
#End If
End Function
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm not sure if it's appropriate to talk about it here, hereby let me mention something about visualized data computing.
Usually, we use R,SQL or esProc scripts for complex data calculation and analytics, while the process of them is quite abstract and difficult for general users. Now, there are some new technology like esCalc, to make the computing more visual and direct,how do you think about it for data calculation?
|
|
|
|
|
David venewald wrote: I'm not sure if it's appropriate to talk about it here, No it's not; this forum is for technical questions on Visual Basic issues (see here[^]). If you want to advertise your product then contact the administrators and buy some ad space. If you want a general philosophical discussion then try the Lounge.
Use the best guess
|
|
|
|
|
Hi, Richard,
I just wanna to talk about visualized computing mode with users, it's not advertising.But thank you for your email anyway.
|
|
|
|
|
Which is why I explained (or tried) to you that this is not the appropriate place. This forum is for technical questions on Visual Basic. If you want to have a general discussion then the Lounge is the place for it..
Use the best guess
|
|
|
|
|
Considering the chances of anyone using any given 3rd party library seeing your post are very, very low, the odds of you getting any meaningful response to this are equally low.
|
|
|
|
|
Hi, Dave, thank you for your answer, but hereby I mentioned is visualized data computing instead of abstract scripting like R, SQL or esProc. Such computing mode may help users more agilely and directly while dealing with complex data process.
I think users will get interested in it if such mode can improve their convenience and efficiency.
|
|
|
|
|
You're not really expecting a discussion on this, are you??
I don't have time for this.
|
|
|
|
|
Hi guys,
i would like to ask on how to use the control Adobe Pdf Viewer in Visual basic 2010 in terms of Saving ,Retreiving and modifying the pdf file displayed on it through sql server 2005 database.
I can do this with image using picture box but how about in pdf files using Adobe Pdf Viewer?
i have a code for saving and retrieving my image
any modification to my code to solve my problem would be appreciated ..
Imports System.IO
Module ModReadWriteImage
Public Sub writeImage(ByVal picbox As PictureBox, ByVal sql As String)
Dim imageBinary = Nothing
Dim myImage As Image = picbox.Image
Dim imgMemoryStream As MemoryStream = New MemoryStream()
Dim imgByteArray As Byte() = Nothing
myImage.Save(imgMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg)
imgByteArray = imgMemoryStream.GetBuffer()
saveImage(imgByteArray, sql)
End Sub
Public Function readImages(ByVal pic As Byte()) As Image
Dim imgMemoryStream As MemoryStream = New MemoryStream()
Dim imgByteArray As Byte() = Nothing
Dim myimage As Image
imgByteArray = pic
imgMemoryStream = New IO.MemoryStream(imgByteArray)
myimage = Drawing.Image.FromStream(imgMemoryStream)
Return myimage
End Function
End Module
Many Thanks.
|
|
|
|
|
As far as sotring and retrieving the PDF file in the SQL server, it's no different. An image file is no different than a PDF file. To SQL server, it's all just bytes.
The problem your have is displaying the PDF. AFAIK, since the Reader Viewer will not use a MemoryStream object, you have to write the file to disk, then tell the Reader the file to load.
|
|
|
|
|
Thanks for your reply
But is there any other soulution to my problem rather than writing the file to the disk?
i just want a direct communication between the pdf file viewer to the database
if you dont mind do you have sample codes for pdf? this will be very helpful for me.
thanks a LOT!
|
|
|
|
|
J.Mañago wrote: But is there any other soulution to my problem rather than writing the file to
the disk?
What did I say?? Using Acrobat Reader, it will ONLY work with files, so NO, there is no other solution. Unless you want to scrap Acrobat and use a 3rd party component. In which case, you've got some researching to do to see what's going to fit your needs and if it's going to be supportable by you.
J.Mañago wrote: if you dont mind do you have sample codes for pdf? this will be very helpful for
me.
I don't have any examples, but I'm sure the Web does. A simple Google for "Using Acrobat Reader with VB.NET" should come up with lots of them.
|
|
|
|
|
I'm trying to create a class which behaves like a Double only allows values within a certain range.
One of the goals is to have it behave as a normal Double, i.e.: being able to assign Double values to it and pass it to functions taking a Double value.
Public Class RDouble
Public Sub New(ByVal D As Double, Optional ByVal Min As Double = 0, Optional ByVal Max As Double = 100)
_MinValue = Min
_MaxValue = Max
_dValue = D
If _dValue < _MinValue Then
_dValue = _MinValue
ElseIf _dValue > _MaxValue Then
_dValue = _MaxValue
End If
End Sub
Public _MinValue As Double
Private _MaxValue As Double
Private _dValue As Double
Public Shared Widening Operator CType(ByVal d As RDouble) As Double
Return d._dValue
End Operator
Public Shared Narrowing Operator CType(ByVal d As Double) As RDouble
Return New RDouble(d)
End Operator
End Class
Sub Main()
Dim rd As New RDouble(50.0, 10.0, 100.0)
rd = 20.54
Dim D As Double
D = Math.Round(rd)
End Sub
The problem with this code is of course that any assignment to the RDouble causes its boundaries to be "reset" since a new one is created with the default _MinValue and _MaxValue; and with the conversion operators being shared there is no way to access the Min/Max values of an instance.
Is there any way to fix this?
|
|
|
|
|