[Help]MSSQL 2005/Hex

Posts 1–3 of 3 · Page 1 of 1
[Help]MSSQL 2005/Hex
Ok I have 2 questions.

1. I want to create a new column in an existing table.

Let's say I have a database called "MPGH". There's a Table named "User". I now want to add the column "Posts" as int(default value 0). How would I do that =D?

The only thing I know is how to connect to the database:

Code:
Dim strConn As String = "Driver={SQL Server};Server=" ";UID=;PWD=;Database=MPGH;"
                       

            Dim conn As New OdbcConnection(strConn)
            Dim cmd As New OdbcCommand(strSQL, conn)

            conn.Open()

            cmd.ExecuteNonQuery()

            conn.Close()
And how to add a value into a column

Code:
Dim strSQL As String = "INSERT INTO [TABLENAME] ([ID],[PWD],[Birth],[Type],[ExpTime],[Info]) VALUES ('" & txtID.Text & "'," txtpwd.text & ",'19190101',0,4000,null)"
2. I want to change some hex code in a file.

The program should overwrite "MPGH 1337 ABCD"(only appears once) with "1337 1337" + replace the other bytes which weren't used (ABCD) with 00 bytes. How would I do that =D?
Uhh. I think i'll just leave it to NextGen, he's the smartass =.=
[php]
Dim strConn As String = "Driver={SQL Server};Server=" ";UID=;PWD=;Database=MPGH;"


Dim conn As New OdbcConnection(strConn)
Dim cmd As New OdbcCommand(strSQL, conn)

conn.Open()

cmd.ExecuteNonQuery()

conn.Close()
[/php]

To create a column dynamically Use DataTable.Columns.Add (datatable = datatablename)

to add information use fill

[php]
Dim ds As New DataSet("Posts")
database1.Fill(ds, "Posts")
[/php]

Just remember Databases are not that simple , your code above and my code won't do much.

Databases require Logic, Stored procedures, Calling stored procedures, dynamic entry, it really isn't something to dive into without atleast learning the basics of MSsql first. MSDN offers a decent MSSQL tutorial, after that move it into vb.net (just a suggestion) I say at first work with local storage
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us