Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 2,800
» Latest member: DavidIrova
» Forum threads: 856
» Forum posts: 3,643

Full Statistics

Online Users
There are currently 3 online users.
» 1 Member(s) | 1 Guest(s)
Google, MorrissgoX

Latest Threads
Looking for Adventure? Fi...
Forum: Random Discussion
Last Post: iHOMEz
11-16-2024, 09:18 PM
» Replies: 0
» Views: 465
Prettys Womans in your to...
Forum: Random Discussion
Last Post: iHOMEz
10-30-2024, 07:45 AM
» Replies: 0
» Views: 744
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-26-2024, 10:50 AM
» Replies: 0
» Views: 778
Beautiful Womans from you...
Forum: Random Discussion
Last Post: iHOMEz
10-19-2024, 02:48 PM
» Replies: 0
» Views: 874
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-06-2024, 05:00 PM
» Replies: 0
» Views: 1,038
Womans from your city - V...
Forum: Random Discussion
Last Post: iHOMEz
07-28-2024, 10:26 AM
» Replies: 0
» Views: 1,414
Supreme Сasual Dating - A...
Forum: Random Discussion
Last Post: iHOMEz
06-14-2024, 11:28 AM
» Replies: 0
» Views: 1,840
Beautiful Womans in your ...
Forum: VB.NET
Last Post: iHOMEz
06-09-2024, 09:23 PM
» Replies: 0
» Views: 1,640
Hangman in Rust
Forum: Other
Last Post: brandonio21
02-04-2018, 11:14 AM
» Replies: 2
» Views: 20,632
How to: Search files from...
Forum: VB.NET
Last Post: brandonio21
11-25-2017, 12:55 PM
» Replies: 1
» Views: 15,951

 
  Very New to Programming Need advice .
Posted by: pwsincd - 05-02-2013, 11:15 AM - Forum: Programming Help - Replies (8)

Hi guys , i trying to develop an app for my son so he can easily admin a mysql database , and after lots of googleing i eventually came across brandons youtube tutorials on sql connection .. Thanks for those man , very helpful.

I have progressed quite well but it seems i have over looked something.

I wanted to make the app useful to others so rather than predetermine the connection string i thought to add simple textbox entries for connection to other DB's of this nature.

Ok so to my problem . to aid in debugging i predetermined the connection string variables to save me typing them in. Now that im ready to try the app i remove the predetermined variable strings and want the textbox entries to come into play.

heres my code :

[code2=vbnet]Imports MySql.Data.MySqlClient

Public Class Form1
'common variables
Public Shared IP As String = "removed for security"
Public Shared DBNAME As String = "removed for security"
Public Shared USER As String = "removed for security"
Public Shared PASS As String = "removed for security"
Public Shared conn_ok As Boolean = False
Public Shared connstr As String = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Public Shared myConnection As New MySqlConnection(connstr)
Public Shared command As New MySqlCommand
Public Shared adapter As New MySqlDataAdapter
Public Shared data As MySqlDataReader

'connection code
'ip address
Private Sub KryptonTextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox1.TextChanged
IP = KryptonTextBox1.Text
connstr = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
End Sub
'Database name
Private Sub KryptonTextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox2.TextChanged
DBNAME = KryptonTextBox2.Text
End Sub
'username
Private Sub KryptonTextBox3_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox3.TextChanged
USER = KryptonTextBox3.Text
End Sub
'password
Private Sub KryptonTextBox4_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox4.TextChanged
PASS = KryptonTextBox4.Text
End Sub
'connection test
Private Sub KryptonButton1_Click(sender As System.Object, e As System.EventArgs) Handles KryptonButton1.Click
' check connection by retrieving sql version
KryptonRichTextBox1.Text = ""
Dim stm As String = "SELECT VERSION()"
Dim Version As String = ""
Try
myConnection.Open()
TextBox1.Text = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Dim cmd As MySqlCommand = New MySqlCommand(stm, myConnection)
Version = Convert.ToString(cmd.ExecuteScalar())

KryptonRichTextBox1.Text = "Successful connection : connected to PermissionsEx database version : " & Version
conn_ok = True

Catch ex As MySqlException
KryptonRichTextBox1.Text = "Connection Error : Please verify your database info is correct and your internet connection is valid."
conn_ok = False
TextBox1.Text = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Finally
myConnection.Close()
End Try
' if connection is ok then check db tables exist
If conn_ok = True Then
Try
Dim sqlquery As String = "SELECT * from permissions"
myConnection.Open()
command.CommandText = sqlquery
command.Connection = myConnection
adapter.SelectCommand = command
data = command.ExecuteReader
Catch extable As MySqlException
KryptonRichTextBox1.Text = "Successful connection : connected to mySQL database version : " & Version & ". However no Permissions EX tables are present , please check your database configuration."
Finally
myConnection.Close()
End Try
Else
KryptonRichTextBox1.Text = "Connection Error : Please verify your database info is correct and your internet connection is valid."
End If
End Sub[/code2]

The problem seems to be that if i run my app and hit my connect button without populating the textboxes it connects using my predetermined values no problems.
If i remove my predetermined values and rely on the textboxes connection fails.

I displayed the connection string in a new textbox to see what was going on , when i connect to the db my outputted textbox string is missing the variables , if i fail to connect using the textboxes , the connection string in the debug textbox is fine .

basically what im saying is i cannot seem to push the textbox entries into a successful connection string.

If screenshots of the app would help let me know.

Print this item

  Help with the java code
Posted by: Helljbb1234 - 05-01-2013, 06:12 AM - Forum: Programming Help - No Replies

I need help this has to be before mothers day. Can anyone tell me the java code so I can make java read an audio file or is it the same as making it read a text file I am using eclipse

Print this item

  NetvOS project
Posted by: MjDev - 05-01-2013, 12:23 AM - Forum: Share your programs! - Replies (6)

Hi guys! This is my first time posting here <!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->
Although my progrma is still in development I wanted to share it. In short it's a kind of full screen dekstop interface (a bit like the windows 8 start screen). Alot of work still has to be done... Suggestions are welcome!

Features:
-Create infinite user accounts (saved as a 'username'.ac file)
-Password are encrypted in 'username'.ac file
-Snap to grid tiles at 'Platform'

A download link can be found here: <!-- m --><a class="postlink" href="http://netvos.zxq.net/download/v6.5.zip">http://netvos.zxq.net/download/v6.5.zip</a><!-- m -->



Attached Files Thumbnail(s)
   
Print this item

  Calculator
Posted by: Aaron Rogers118 - 04-28-2013, 07:05 PM - Forum: Programming Help - Replies (4)

I'm slowly learning java, mostly from Brandonio21's videos, and I have run into a problem. I need to know what I need to do with this code:
[code2=java]package howto;

import javax.swing.JOptionPane;

public class Calculator {

public static void main(String[] args)
{
JOptionPane myIO = new JOptionPane();
double inputText = myIO.showInputDialog("Please enter length:");
double lingth = inputText;
double inputText1 = myIO.showInputDialog("Please enter length:");
double width = inputText1;

double area = (lingth * width) / 2;

JOptionPane.showMessageDialog(null, "The area of the triangle is: " + area);
}
}[/code2]
I need help soon because it is for a school project called "How to".

Print this item

  How do I go about doing this?
Posted by: Ecnarf - 04-22-2013, 03:52 PM - Forum: Programming Help - Replies (1)

I am trying to make it so that a button remains held down rather then pressed using a timer, but I can't figure it out. If someone could tell me if this is possible or not I would appreciate it. Thanks!

Print this item

  How to play random .wav files with a button click
Posted by: STrooper501 - 04-17-2013, 03:32 PM - Forum: Programming Help - No Replies

Seems like it should be relatively simple, but I can't quite get it. I want to create a series of buttons that each play a random .wav file from a different category. I have all my .wav files grouped into different directories based on the button I want them to be associated with. I have been able to make a singular .wav file play when I click the button but I want it to be different audio file each time I click it.

Edit: I suppose I should mention that while I'm pretty good with a computer I'm COMPLETELY new to anything programming related. So just assume I know little to nothing when it comes to explaining things. Thanks for any help!

Print this item

  Reading material..
Posted by: Knight - 04-14-2013, 12:14 PM - Forum: Java - No Replies

Hey all.

Except Brandonio's great videos, can please tell me reading/video materials. That are good too.

Best would be, basics and than jdbc.
Main thing, that i wan't to learn is make application (Chat) and use my design => <!-- m --><a class="postlink" href="http://screencloud.net/v/wQH9">http://screencloud.net/v/wQH9</a><!-- m -->

Terms? Things what i need to know? Tips?

I will appriciate all. <!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->

Print this item

  Properties
Posted by: brandonio21 - 04-11-2013, 05:20 PM - Forum: Code Snippets - Replies (1)

Properties are essential if you are creating a custom object. Essentially, properties are the things that can be edited in the "visual designer" - all of the things that are accessible via the properties window in the lower right hand corner of Visual Studio.

Adding basic properties to your form is easy. All you need is an instance variable and a property block. Then you're all set. For example, here is a sample property arrangemenet:
[code2=vbnet]Private _messageString As String
Public Property MessageString As String
Get
Return _messageString
End Get
Set(value As String)
_messageString = value
End Set
End Property[/code2]

Of course, in this example we use a String object. In the real world, any object can be used. After this is added to your object, the user will be able to edit the properties via the properties Window and give this variable a specific value.

What if you wanted to give the user a list of options to choose from, though? This can be doing by combining properties with enumerations. Thus:
[code2=vbnet]Private _messageString As messageIdentifier
Public Property MessageString As messageIdentifier
Get
Return _messageString
End Get
Set(value As messageIdentifier)
_messageString = value
End Set
End Property

Enum messageIdentifier As Integer
Greetings = 1
Goodbyes = 2
Warning = 3
Declaration = 4
End Enum[/code2]

Although the above code snippet may seem rather ridiculous since the Enumerations don't actually correspond to anything, this is a way of offering the user a list of options to choose from. In this case, the list will contain "Greetings", "Goodbyes", "Warning", and "Declaration". You can then work with this choice by processing the enumeration in some way, as such:
[code2=vbnet]Private Function GetMessageString() As String
If (_messageString = messageIdentifier.Declaration) Then
Return "Of Independence"
ElseIf (_messageString = messageIdentifier.Goodbyes) Then
Return "It has been a fun time, but I must leave you."
ElseIf (_messageString = messageIdentifier.Greetings) Then
Return "Salutations, my good man/woman"
ElseIf (_messageString = messageIdentifier.Warning) Then
Return "Back off! You have no business in this area."
Else
Return ""
End If
End Function[/code2]


Thus, it is really easy to give the user the ability to edit properties when they add your custom control to their form. The only downside occurs when you update a property to be a different object, but do not change the value of the property. Massive errors ensue.

View the video here: <!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=JAK6veamu8o&feature=youtu.be">http://www.youtube.com/watch?v=JAK6veam ... e=youtu.be</a><!-- m -->

Feel free to download a sample project:
[attachment=0]<!-- ia0 -->PropertyTutorial.zip<!-- ia0 -->[/attachment]



Attached Files
.zip   PropertyTutorial.zip (Size: 74.13 KB / Downloads: 656)
Print this item

  Making Your Program Start with Windows
Posted by: brandonio21 - 04-09-2013, 03:10 PM - Forum: Code Snippets - No Replies

I know I have received several PMs and emails regarding making your VB.NET application start with Windows, and I finally got around to creating a nice code snippet.

The first thing you need to do is as the "Windows Script Host Object Model" COM object as a reference to your project. This is very important.

Next, you will want to import the reference:
[code2=vbnet]Imports IWshRuntimeLibrary[/code2]

Now you're good to go and you can start your application with Windows. Essentially, this code will create a shortcut in the users "Startup" folder, forcing Windows to start the application when the computer is turned on.

This code will create the shortcut/start the program with Windows:
[code2=vbnet]'create path variables
Dim startupPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
Dim executablePath As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
Dim executableName As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName
'create shortcut
Dim Shell As WshShell
Dim Link As WshShortcut
Try
Shell = New WshShell
Link = CType(Shell.CreateShortcut(startupPath & "\" & executableName & ".lnk"), IWshShortcut)
Link.TargetPath = executablePath
Link.Save()
Catch ex As Exception
MsgBox(ex.Message)
End Try[/code2]

This code will remove the shortcut/stop the program from starting with Windows:
[code2=vbnet]Dim startupPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
Dim executableName As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName

Dim directoryInfo As New System.IO.DirectoryInfo(startupPath)
Dim fileInfo() As System.IO.FileInfo
fileInfo = directoryInfo.GetFiles("*.lnk")
For Each file As System.IO.FileInfo In fileInfo
If (file.FullName.Contains(executableName)) Then
file.Delete()
End If
Next[/code2]


Optionally, you can eliminate the deletion of files with similar names by changing file.FullName.Contains(executableName) to file.FullName.Equals(executableName)


Watch the video here: <!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=VpPqPtTjMzQ&feature=youtu.be">http://www.youtube.com/watch?v=VpPqPtTj ... e=youtu.be</a><!-- m -->


[attachment=0]<!-- ia0 -->StartupTest.zip<!-- ia0 -->[/attachment]



Attached Files
.zip   StartupTest.zip (Size: 91.73 KB / Downloads: 705)
Print this item

  Mobile Development
Posted by: dmarks2061 - 04-07-2013, 06:48 AM - Forum: Programming Help - No Replies

I want to do some 'droid development and I'm looking for the best way to get up to speed quickly. Everybody says Java is the way to go, but I'd like to find a 'trail' that will get me there. "There's an app for that," right? I want to write some of those apps and publish them in the Play Store. Any suggestions?

Print this item