Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day guys...i have a problem with working with sql server
My problem is i have created an application with vb.net and connected it to sql server. But i want to know how to connect sql to other computers so that when i install my application on the computers the users can enter data from their PC to the PC which i will claim as my server. which means that the other computers can share data among themselves and also retriever data from any other PC which is connected to the server...

thanks. I will appreciate it if any one can help.
Posted
Comments
[no name] 24-Jun-14 20:00pm    
Are all of these computers on the same network? Then it's easy. Just use the server computer in your connection string.
TugBest 25-Jun-14 10:43am    
thank you very much for ur answers i really appreciate it....
But one more thing is that do i need to install the whole sql server on all the other computers or i have to only install the applications which was created from my vb.net program

THIS IS MY CONNECTION STRING:
Dim strcon As String = "provider=sqloledb;Data Source=(local);Initial Catalog=TUGdB;Integrated Security=SSPI"
[no name] 25-Jun-14 18:33pm    
No you only have to install SQL server on one computer that all the other computers can connect to. Hence the name SQL Server.
Nareshkumar Shah 25-Jun-14 5:39am    
make one PC as a server, and connect it thru application from all PCs.
TugBest 25-Jun-14 10:39am    
thank you very much for ur answers i really appreciate it....
But one more thing is that do i need to install the whole sql server on all the other computers or i have to only install the applications which was created from my vb.net

first you need to give your server name instead of (local) as datasource in connectionString.
 
Share this answer
 
Comments
TugBest 1-Jul-14 13:43pm    
tank u sooo much
Hi try this Connection String

SQL
Data Source=ServerName/ServerIpAddress,1433;Network Library=DBMSSOCN;
Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;



Be Sure to Enable TCp/IP Enabled in SQl Server using Sql Configuration Manager and also enable Allow remote connection in you sql server using management studio

link to enable Remote Connection and TCP/IP and Firewall protection
is
http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx[^]


link to Enable TCP/IP
http://msdn.microsoft.com/en-us/library/bb909712(v=vs.90).aspx[^]
 
Share this answer
 
v2
Comments
TugBest 1-Jul-14 13:42pm    
tank u very much ..i really appreciate it,,
TugBest 28-Jul-14 7:31am    
Please i need help...

I get NO errors when i type few sentences in the CommentsTextbox but when i type long sentences and more words and i try to Update or Insert i get the errors below:


Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a Semicolon.

this is my Sql String:

"update set IDNo='" + IDNOTextBox.Text + "',Comments='" + CommentsTextBox.Text + "' where Prescriptions like '" + TextBox1.Text + "%'"

i will appreciate it i a get an answer.....thanks in advance
Balav4 2-Aug-14 0:46am    
Hi I guess this might be the error
Check you text having apos "'" in case there is any apos that will consider as syntax error
so pass it as parameter

Eg
SqlCommand Cmd = new SqlCommand("Insert into Category (CategoryName) VAlues (@CategoryName)", conn);
Cmd.Parameters.AddWithValue("@CategoryName", TeNewCategory.Text);
cmd.executeNonquery();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900