Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assistance with Deployment

Status
Not open for further replies.

thefox149

Technical User
Nov 22, 2004
158
AU
I am a newb to sql server and vb.net

I have created a program that uses a sql server express dbase. I know wish to deploy this to users.

The app will be depolyed in small offices of about 5-10 users.

Hers come the questions
1. I would like to put the actual database on one of the networked machines "quasi server" and all other desktops link into it however in all documentation I cannot find an example that allows me to map my front end to the database. or how to acutally do this where by I have a database installation disk.

I have not copied my database into my proeject as this would include the databse in the published app meaning every machine would have it's own database...not good.

Access was perfect and simple to use in this type of structure using the good old table relink fucntions. Is there not the same in Vb.net to sql server. I have to go down the sql server express path due to the lack of office and the lack of management paying for licenses



My cat's name is sprinkles
-Ralph Wigam
 
I have found where my connection string is store in the app.config file this is an xml document..WouldI have to go around into each installtion and physically change the path or is there a procedure i can write that will show a file dialog box allow the user to point to the mdf file and this will update the app.config xml file?

My cat's name is sprinkles
-Ralph Wigam
 
What version of .net are you using?

Because you have your connectionstring in the app.config I guess you used the wizard to make it.

But you can still change the connectionstring of a connection by setting it via code. Probably in the load of the first form.

And all the rest really depends on the version of .net.

Christiaan Baes
Belgium

"My new site" - Me
 
.net v2.0 yes the wizard made my connection...damn wizard


My cat's name is sprinkles
-Ralph Wigam
 
Yep damn wizard.

You really shouldn't use them but anyway.

For one I would create an application setting for your project (look in the properties of your project for settings) something like databaseserver.

and give it the name of the server you have o rmake it a user setting so you or the user can change it at runtime.

and then you need to change the config file whenever you load the project or whenever the user changes the value.


and if you really want to stick with the wizard generated thing then you will need to change the config file at runtime. (not easy)

more information here


Or you could just setup your testserver and give it the same name as the live server (if they aren't on the same network).

Christiaan Baes
Belgium

"My new site" - Me
 
I can still change it and code the connection using ado.net...but as I am a newb was not confidant

My cat's name is sprinkles
-Ralph Wigam
 
Wizard make life easy in the beginning but it soon turns into hell.

I think that learning OOP and the use of patterns (MVC) and using a good dataacceslayer method can save you lots of time in the future. I found it best to learn these things in another language like JAVA.

Christiaan Baes
Belgium

"My new site" - Me
 
this is driving me nuts my data will not update...I keep getting the error "Update requires a valid updateCommand when passed DataRow Collection with modified rows"

what's going on here?

Imports System.Data.SqlClient

Public Class Form1

Friend das1 As New DataSet
Friend dapClaims As SqlDataAdapter


Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
cnn1.Close()
MessageBox.Show("Closed")
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'connects to dbase
Module1.Dbaseconnection()

Dim sQuery As String

sQuery = "SELECT * FROM tblClaims"
dapClaims = New SqlDataAdapter(sQuery, cnn1)
dapClaims.Fill(das1, "tblClaims")



Me.DataGridView1.DataSource = das1.Tables("tblClaims")


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

dapClaims.Update(das1.Tables("tblClaims"))

End Sub


End Class

My cat's name is sprinkles
-Ralph Wigam
 
solved it with this....

bld1 = New SqlCommandBuilder(dapClaims)

to those out there who rely on wizards learn to code fully you will understand not only your app but but is really going on giving you full control ...

My cat's name is sprinkles
-Ralph Wigam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top