|
>> my theme form will be vista them with out change windowa
If I'm understanding correctly, you just want a different look for your forms. If this is the case, you have to do several steps.
1) Create an image of the way you want the form to look
2) Create a new form in VB
3) Set the background image of the form to your image
4) Set form to be transparent
5) Optional - turn off control bars (especially if you have rounded edges to your custom form)
There's a good write up in Microsoft's C# forums. Other than a few syntax changes, it works for VB too. I haven't tested this myself yet, but the write up was pretty thorough.
|
|
|
|
|
hi friends,
i am suffering with a problem in database programming. my need is to execute a sql scritp using vb.net. i have a file having extension .sql. i want this file to be executed programically.
pls help me.
|
|
|
|
|
' Create a stream to read the sql file
Dim reader As StreamReader = New StreamReader(path)
' Read the contents of the file into a string variable
Dim sqlScript as String = reader.ReadToEnd()
' Execute the sql on the database
Dim command as New SqlCommand(sqlScript, New SqlConnection(connStr))
command.ExecuteNonQuery()
|
|
|
|
|
There's one additional aspect to add to this. If your file was created in Enterprise Manager using "Generate SQL Script" then it's going to have "GO" commands through out it. You'll need to add code to remove that by parsing it line by line. If this is the case, then use something like this:
<br />
'Open Script from file name.<br />
Dim oStreamReader As System.IO.StreamReader<br />
Dim sb As New System.Text.StringBuilder<br />
Dim sTemp As String = ""<br />
oStreamReader = New IO.StreamReader(ScriptName)<br />
<br />
'Loop Through Lines until done<br />
Do<br />
Dim cmd As New SqlClient.SqlCommand<br />
sb = New System.Text.StringBuilder<br />
Do<br />
sTemp = oStreamReader.ReadLine<br />
If sTemp > "" And sTemp <> "GO" Then<br />
sb.Append(sTemp + vbCrLf)<br />
End If<br />
Loop Until (sTemp = "GO" Or oStreamReader.Peek = -1)<br />
<br />
''Execute chunk against database<br />
'oStreamReader.ReadLine()<br />
If sb.ToString > "" Then<br />
Try<br />
cmd.CommandText = sb.ToString<br />
cmd.Connection = cn<br />
cmd.ExecuteNonQuery()<br />
cmd.Dispose()<br />
Catch ex As SqlClient.SqlException<br />
MessageBox.Show(ex.Message)<br />
<br />
End Try<br />
End If<br />
'MessageBox.Show(sb.ToString)<br />
sb = Nothing<br />
'oStreamReader.ReadLine()<br />
<br />
Loop Until (oStreamReader.Peek = -1)<br />
cn.Close()<br />
I just wrote an app last week that did this exact thing.
|
|
|
|
|
you can use
<br />
Imports System.IO<br />
public sub RunSQL<br />
Dim conn As New SqlClient.SqlConnection<br />
Dim sqlCmd As New SqlClient.SqlCommand<br />
Dim sqltxt As String<br />
<br />
conn.ConnectionString = ("Data Source= " + DS + " ;Initial Catalog= " + DB + ";Integrated Security=True")<br />
conn.Open()<br />
<br />
sqltxt = System.IO.File.ReadAllText("SP.sql")<br />
sqlCmd.CommandText = sqltxt<br />
sqlCmd.Connection = conn<br />
sqlCmd.ExecuteNonQuery()<br />
conn.Close()<br />
<br />
this code will read the file once and execute it
|
|
|
|
|
Hi all,
i need to edit file on the target folder and this editing must run in Uninstalling this program
what exaclty shall I do?
|
|
|
|
|
In your setup project open up the Custom Actions Editor. Here you can specify other actions to do during installation or uninstallation. You'll have to make a new .exe to edit the file and place that .exe it in the Uninstall folder here.
|
|
|
|
|
i create new class that display warning message if he find string in text file and this code inside Sub of the class so
how can i call this function from the dll in the setup project while uninstall
Code :
<br />
Imports System.IO<br />
Imports System.Windows.Forms<br />
<br />
Public Class Uninstall<br />
Dim str As String<br />
Public Sub FixDynamics()<br />
str = System.IO.File.ReadAllText("Test.txt")<br />
If str.Contains("Auto") = True Then<br />
MessageBox.Show("Exist txt")<br />
End If<br />
<br />
End Sub<br />
-- modified at 3:26 Thursday 25th May, 2006
|
|
|
|
|
|
hi there,
we have to go front and back as there is option in web pages , can we accomplish in standalone application?
bharath.s
|
|
|
|
|
Are you referring to a windows app? If that's the case then you just set the button to load the appropriate form.
|
|
|
|
|
hi there, i wanted to have that navigating front and back option in windows standalone application. Can that be done?
bharath.s
|
|
|
|
|
hello, i want a form to show me a username i write in a textbox from a database. if i want to search for username: adrian a datagrid will contain all adrian usernames. how can i do this?? thanks alot for all of your help!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You need to set up your SQL query to be something like this
strName = "adrian"
sSQL = "Select * from Table where username like '%" & strname & "%'
That search statement will get everything that contains adrian in the username.
|
|
|
|
|
hellow to all ..
i am looking for a code or a artical that can help me format textbox the way i like , for exsample , i wanna the textbox only to recive dig numbers and to attach "-" , after the 3d number ,,
thxx for anyhelp .
|
|
|
|
|
|
i deployed the VB.net program with crystal reports.
but a strange bug appear on client machine.
when the user open the crystal report, the data is printed and everything is fine but when he is scroll down or up, left or right... sudenlly the program become not response and freezed, and he should terminate and restart the application.!!!!1
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
Hi,
am looking for som1 who has already done or is doing work on "Software estimation tool" am using OP, FP and LOC as sizing techniques and for the remaining am working with COCOMO early-staged estimation, COCOMO II, and UCP's....coding wiz vb.net and SQL Server as back-end.
Thanx
Shai
|
|
|
|
|
Instead of using all the SMS-SPK and acronyms, why not try actually putting your question in full English. Your chances of getting any sort of answer will improve loads!!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi can some1 help me out with vb.net codes for email addres validation with vb.net.
Thanx
|
|
|
|
|
Hi,
For this you can use RegularExpressionValidator.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi, there!
As mentioned above you could use the RegularExpressionValidator control in a form, or you could use this function in your code:
Function IsValidEmailAdress(emailAdress As String) As Boolean<br />
Retrun Regex.IsMatch(emailAdress, ("\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"))<br />
End Function
Be sure to include System.Text.RegularExpressions in your class:
(Imports System.Text.RegularExpressions )
Good luck!
Best regards
j-on
|
|
|
|
|
|
Hi All,
I searched the net for applications that upload binary data files from client machine to server one.multiple clients can send at the same time.
All the samples i found works correctly if the size of the file is small ==> 1024 bytes or less only.
I need to make it work for larger files too. i don't have much experience in IO and Sockets issues
I can bring the code here.if any one can help me...
any comment will be very usefull..
Thanks in advanced..
shelal
shelal
|
|
|
|
|
It sounds like you're trying to create an FTP program. I remember seeing some sample FTP programs on Microsoft's site not that log ago. The basic idea is that the "server" will stay open at all times. When it starts you'll bind the app to a local unused socket. Then your clients will connect to that socket and a connection is created. All you have to do then is use the socket.send command with the correct parameters.
If you do a search for source code for an ftp server and ftp client you'll get a lot more examples. then you can customize it to fit your specific need.
|
|
|
|