|
Thanks in adv.
i have made one setup in VS 2008 to deploy a project having sql server 2005 as a back end and VS2008 as front end with default Crystal reports
I am getting this error when trying to run application but it runs fine where VS2008 is installed and no error comes
a network-related or instance-specific error occurred while establishing connection to sql server , the server was not found or was not accessible, verify that instance name is correct and SQL server is configured to allow remote connections (provider : Named Pipes Provider , error:40 could not open a connection to Sql Server)
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
It would appear that either the SQL Server is not configured to accept network connections (which is default in a new installation) or the connection string is wrong somehow. Which version of SQL Server are you using? Is it an Express Edition? Does the database exist on the server?
|
|
|
|
|
Sql server 2005 , no its not express edition , problem is that on a same network it works fine and no error comes where vs2008 is installed and it could not connect on the PC where vs2008 is not installed
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
What does the connection string look like?
|
|
|
|
|
I have one Solution which contains different projects one of them is GUI , and another is DAL
DAL has a connection string in DAL Settings/Configurations looks like this
<br />
Data Source=SOFTDEV;Initial Catalog=DB;Persist Security Info=True;User ID=user;Password=pass<br />
and i calls this at GUI by adding the project reference to GUI.
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
OK, so can you ping the SOFTDEV machine from the ones that cannot connect?
If so, what is the SOFTDEV machine? Does its SQL Server have TCP/IP connections turned on?
|
|
|
|
|
Yes it is pinging
when applications is installed then i am changing the Server Name (which is pinging) in the file "Dal.exe " xml config file.
in code i am getting connection string like this
<br />
Public gConnectionString As String = My.Settings.ConString.ToString<br />
changing the file will give me the new Server Name or not as in source code in app.config if i change server name then by clicking on My Project it says that the app.config file is changed
changing app.config is same as changing the My Project ====> Settings means it will update my settings file or i have to do something else
Thanks alot for the help.
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Absolutely none of this made any real sense at all.
So, basically, you're testing this on your development box and the database is on your development box, correct?
When you deploy the app, you're changing the SQL Server name in the Dal.exe.config file, but it's not working, correct?
OK, again, is the SQL Server on the target machine configured to accept connections over TCP/IP? If not, change it.
Does the database exist on that server in the default instance or is it in another SQL Server instance?? If not, create it, or change your connection string to reflect the correct instance name.
softdev_sup wrote: changing app.config is same as changing the My Project ====> Settings means it will update my settings file or i have to do something else
An app.config file is nothing but a text file containing XML data. You can change the Dal.exe.config file any time you want to reflect the new SQL Server computer name you're trying to connect to. You DO have the correct server name, right?
softdev_sup wrote: Public gConnectionString As String = My.Settings.ConString.ToString
You realize you're one of those people who calls .ToString() on a String, needlessly, right?
|
|
|
|
|
"When you deploy the app, you're changing the SQL Server name in the Dal.exe.config file, but it's not working, correct?"
yes this is what i am trying to do , i have done it alot of time but dont know whats wrong in it this time other projects are working fine , connection string is ok , i tried odbc its also connecting , i will try tomorrow by getting the connection string on the message box with exeception message and will see that its getting which connection string ,
you are right about ToString() , i tried to rap that as much as i can bcz of that error , anyhow i will try tomorrow and will let you know also , i think so its only bcz of connection string some other project might also have some connection string which it is getting
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Either you have a connectiong string, or part of it, hard-coded into your app, or you're not changing the correct connection string int he .config file on the machine you installed the app on, or you're not editing the correct .config file. It should be the applications config file, not one you may have put in for a .DLL project.
|
|
|
|
|
yes you r right it was reading connections string from another project, i solved it thank you so so much for your help
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Hi everybody,
I have to develop a hangman game as a school project.
I,m using VB.NET 2005.
My problem at the moment is that I have to create an array and upload the letters of a word into the array.
then read each letter into a textbox.
Here is the code that I have so far please help.
I've put a comment in area I think is troubled
Public Class frmGame
Friend array(20) As String
Dim word As String = "Hangman"
Dim letters As Integer = word.Length
Private Sub Closetop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Closetop.Click
End
End Sub
Private Sub new_word()
Dim i, f, g As Integer
'Trouble Area
Do Until letters
array(i = i + 1) = word.Chars(f = f + 1)
Loop
txtLetter1.Text = array(1)
txtLetter2.Text = array(2)
txtLetter3.Text = array(3)
txtLetter4.Text = array(4)
txtLetter5.Text = array(5)
txtLetter6.Text = array(6)
txtLetter7.Text = array(7)
txtLetter8.Text = array(8)
End Sub
Private Sub frmGame_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
new_word()
End Sub
End Sub
End Class
|
|
|
|
|
Hi
Try This
Private Sub new_word()
Dim i, f, g As Integer
Dim array() as char = word.toCharArray()
‘Do Until letters
‘array(i = i + 1) = word.Chars(f = f + 1)
‘Loop
txtLetter1.Text = array(1).ToString
txtLetter2.Text = array(2).ToString
txtLetter3.Text = array(3).ToString
txtLetter4.Text = array(4).ToString
txtLetter5.Text = array(5).ToString
txtLetter6.Text = array(6).ToString
txtLetter7.Text = array(7).ToString
txtLetter8.Text = array(8).ToString
End Sub
|
|
|
|
|
I tried that just now.
Just calls up an unhandled exception in my array
so the data doesn't go into my array.
|
|
|
|
|
whats like that:
Private Sub new_word()
'Trouble Area
txtLetter1.Text = word.Chars(1)
txtLetter2.Text = word.Chars(2)
txtLetter3.Text = word.Chars(3)
txtLetter4.Text = word.Chars(4)
txtLetter5.Text = word.Chars(5)
txtLetter6.Text = word.Chars(6)
txtLetter7.Text = word.Chars(7)
txtLetter8.Text = word.Chars(8)
End Sub
|
|
|
|
|
Ok but is it possible to do that with a loop.
to minimize coding.
kind of like i did the loop in the first one?
And what about my array or is that redundant?
|
|
|
|
|
of course this is possible with a loop! this would be a much better way of coding!!
the array is redundant in that short code, because the word contains a array or is an array of characters.. retrieve the array by word.GetCharArray().. someone postet above..
if you want this working with "all words" existing xD than create the textboxes dynamic and fill them dynamic looping through the word..
iterate through the word to get each character create a textbox for the character and fill it..
greeettz
|
|
|
|
|
I have absolutely no idea what you just said there but if it can work thanx.
can you give me some kind of example please?
the only way i know if itterating through the word is :
do until
word.chars( i += 1)
loop
|
|
|
|
|
here this could be ONE way..
Public Sub new_word(byval word as String)
Dim c As Char
Dim tb As TextBox
'remove all controls from form..
me.Controls.Clear()
' iterate through the word
For Each c In word
'create a new textbox
tb = New TextBox
tb.Tag = c ' hold the word to compare with entered char
tb.Text = string.Empty ' set the empty string (user has to enter..)
tb.Dock = DockStyle.Top '..
' add event if user enters a text
AddHandler tb.TextChanged, AddressOf Me.charChanged
' add the control to form
me.Controls.Add(tb)
Next
End Sub
Private sub charChanged(byval sender As Object,byval e As EventArgs)
Dim tb As TextBox
tb = directcast(sender, TextBox)
If not tb Is Nothing Then
If tb.Text = tb.Tag Then
tb.BackColor = System.Drawing.Color.Green
Else
tb.BackColor = System.Drawing.Color.Red
End If
End If
'.....
End Sub
|
|
|
|
|
Thanx for the example it helped a lot.
Hopefully I'll get it working now.
will also post if i get it working.
Thanx all
|
|
|
|
|
hi,expert i want to run css or style_sheet in vb.net
thanks
|
|
|
|
|
|
Weird. You're the second person to ask this, this week. While there is an article on trying to do this, it's absolutely retarded. CSS sucks at the best of times, and it's not applicable to winforms, You should find another way of creating styles to apply to your forms.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hey Christian, just out of curiosity, what's the quarrel with style sheets? You are always on the ball it seems, so I'm curious, what's the reason for;
Christian Graus wrote: CSS sucks at the best of times
|
|
|
|
|
CSS is a series of arcane and unrelated rules. It doesn't seem to have any logic or design to it. Perhaps I was just spoiled in having a CSS guru ( who, incidentally was useless at anything else ), so I've never had to learn it, I've just had to mess with it from time to time. But, I have to say that only 'classic ASP' has ever felt like more of a mess to me than CSS does.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|