|
Hello !
Using vb.net , how can I search and list the sql server instances running on local Pc and on local network ?
For each sql server instance I need to know the server name and database instance name.
Thank you !
|
|
|
|
|
|
Thank you !
But , is this going to work with other version of sql server for example 2012 , 2014 or 2016 ?
|
|
|
|
|
|
Yes I've tried it.
But on my Pc i have sql server 2008. On network i have sql server 2014 and 2016.
The code only work for sql server 2008 . Does not work for Sql server 2014 and 2016.
|
|
|
|
|
|
Yes , does not work with sql server 2014 and 2016.
|
|
|
|
|
Hello !
I have a vb.net 2003 application.
I have a form when users can upload images ( .jpg ) from files or from scanners. When a image is inserted , a link is kept in a database as a record.
I want to keep this uploaded images in a format that can be opened only from my application and not by windows explorer.
Is there anything I can do ?
Thank you !
|
|
|
|
|
Encrypting the file content seems to be the very obvious choice.
You'll have to decrypt the content, of course, when you want to show these images.
|
|
|
|
|
Can you suggest to me an encrypting library that I can use or something else ?
( And to better clarify what I want , when the user upload the file , I want to save this file in some folder , but the user should not be able to open this file from windows explorer or from other programs, but only when he try to open from within my application )
|
|
|
|
|
Like hijacking the data?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Just Google for "VB.NET encrypt decrypt file". You'll come up with tons of examples.
|
|
|
|
|
In an existing vb.net 2010 application that accesses a sql server 2012 database, I only want to modify the exsiting sql to add a comment saying what
cs.attributeID = 2775 and cs.attributeID = 2771 means in the following sql right next to the line where the sql actually exists.
Const sql As String = "SELECT CS2775.Personid,SchoolYearValue,SchoolYearName,CS2775.StatusDateTime " _
& " from " _
& "(SELECT cs.Personid,cs.value as SchoolYearValue, cd.name as SchoolYearName , [date] AS StatusDateTime " _
& " FROM TEST.DBO.customstudent cs WITH (NOLOCK)" _
& " JOIN TEST.DBO.CampusDictiONary cd " _
& " ON cs.attributeid = cd.attributeID AND cs.value =cd.code" _
& " WHERE cs.attributeID = 2775 " _
& " GROUP BY personID, cs.value, cd.value,name,[date]) as CS2775 " _
& " LEFT JOIN (SELECT Personid,value as Edcounsel1CP, max([date]) AS StatusDateTime " _
& " FROM TEST.DBO.customstudent WITH (NOLOCK)" _
& " WHERE attributeID = 2771 " _
& " GROUP BY personID, value ) as CS2771 " _
& " ON CS2771.PersonID = CS2775.Personid " _
& " AND CS2771.StatusDateTime = CS2775.StatusDateTime " _
& " WHERE CS2775.Personid = @studentlink ; "
I want to make this change since I am adding more 2 attribute values to an extensive long list of existing attribute values. Management would
not let me change the existing sql since it is not cost effective.
The only thing I know what to do is to place the comments prior to the string assignment statement. Thus would you show me the code of how I can add
the comments I would like to place in the sql listed
|
|
|
|
|
Assuming you want the comments in VB, and not in the actual query:
However, if you're using Visual Studio 2010 or later, you don't actually need the line continuation character. You just need to move the & from the start of the line to the end of the previous line:
Const sql As String = "SELECT CS2775.Personid,SchoolYearValue,SchoolYearName,CS2775.StatusDateTime " &
" from " &
"(SELECT cs.Personid,cs.value as SchoolYearValue, cd.name as SchoolYearName , [date] AS StatusDateTime " &
" FROM TEST.DBO.customstudent cs WITH (NOLOCK)" &
" JOIN TEST.DBO.CampusDictiONary cd " &
" ON cs.attributeid = cd.attributeID AND cs.value =cd.code" &
" WHERE cs.attributeID = 2775 " &
" GROUP BY personID, cs.value, cd.value,name,[date]) as CS2775 " &
" LEFT JOIN (SELECT Personid,value as Edcounsel1CP, max([date]) AS StatusDateTime " &
" FROM TEST.DBO.customstudent WITH (NOLOCK)" &
" WHERE attributeID = 2771 " &
" GROUP BY personID, value ) as CS2771 " &
" ON CS2771.PersonID = CS2775.Personid " &
" AND CS2771.StatusDateTime = CS2775.StatusDateTime " &
" WHERE CS2775.Personid = @studentlink ; "
If you do want the comments to be part of the query, then you'll need to use SQL's multi-line comment syntax:
& " WHERE cs.attributeID = 2775 /* A comment */ " _
You can't use the single-line comment syntax, because your query is all on one line, and everything after the comment would also be commented out.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks that works well!
|
|
|
|
|
I have an application that populates an Adobe form using iTextSharp, then launches the form in a new Adobe window. The issue I'm running into is that Adobe Acrobat 11 crashes when opening the file.
Dim p As New Process
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal
p.StartInfo.FileName = AdobePath
p.StartInfo.Arguments = String.Format("/n {0}{1}{0}", Chr(34), SaveFilePath)
p.Start()
The interesting thing is that Adobe opens fine if there's a message box before the Start method. As soon as I remove the message box, Adobe goes back to crashing when loading the PDF.
I thought that maybe there was a situation where the file hadn't finished writing or closing, so I replaced the message box call with a sleep statement. The sleep statement, regardless of how long I have it wait, still results in Adobe crashing.
The code has been used for years across multiple versions of Adobe Acrobat and Reader. There have been no issues until the business started updating users to Adobe Acrobat 11.
Additionally, the file opens fine manually even when emulating the start process by using the command line or a shortcut.
|
|
|
|
|
in making written answer question paper.i used textbox to submit the answer.then check answers through the if satement and i want to take sum of correct answers this is code for one questio that i used,
Private Sub CommandButton1_Click()
If TextBox1.Text = "8" Then
numberCorrect = numberCorrect + 1
MsgBox "wel done"
SlideShowWindows(Index:=1).View.Next
Else
numberWrong = numberWrong + 1
MsgBox "Try again"
End If
TextBox1.Text = ""
End Sub
|
|
|
|
|
And what is your question?
|
|
|
|
|
I have a windows forms vb.net application (VS210) that automates a process simulator. I have an old version of the simulator application on my development machine, so I reference the com library at design time. However, my clients will have a newer version of the library. So, how do I use a config file to add the reference at runtime?
Maybe you can give an example or a reference. I couldn't understand what I got from Microsoft.
|
|
|
|
|
Hello dear everyone. I came up with creating an app that displaying the signal bar strength of the network that i am connected with. I can't find any site that guiding to code it in VB.Net so I unable to start with any of it. Could anyone suggest me which site that I can use to learn or maybe you can provide some suggestion on how to start with it? Thank you so much.
|
|
|
|
|
|
This is one of the forum that I think related to what I am looking for WMI to get SSID and signal strength information - Visual Basic .NET[^] but I am lost because I don't really know where to start. For example I don't understand about the WMI. I though it is clear enough if I mention about Display network signal strength using windows form application.
|
|
|
|
|
|
Sure, thanks
|
|
|
|