|
Thanks Dave,
No, the server is on the same machine.
Garth
|
|
|
|
|
In that case, we'd need the connection string. Your other post was apparently full of XML tags, so the string never showed. Post just the connection string, not the enclosing XML tags.
|
|
|
|
|
Thanks Dave,
Please tell me where I would find the connection string that you need? Machine.config? Which one?
Garth
|
|
|
|
|
This is the connection string from the machine.config file in the C:\WINDOWS\Microsoft.net\framework\v2.0.50727\CONFIG file.
connectionstring = "data source=.\SQLEXPRESS; Integrated Security=SSPI;AttachDBFilename=|DataDirectory|GGTEST.mdf;User Instance=true" providerName="System.Data.SqlClient"
|
|
|
|
|
The connection string you posted is for an Express Edition of SQL Server, not for the Developer or normal editions.
First, is the GGTEST.mdf file in the same directory as the .EXE you launched? While debugging, this would be in the Debug or Release folders under the bin folder in your project folder.
|
|
|
|
|
Dave,
Thanks for hanging in there with me.
I may not be looking in the right place for the connection string.
The one I sent you I found in a machine.config file. I've been messing with it and regardless what I set the file name or server instance to, the sql server management studio and the sql server connection manager connect to my db just fine. That tells me that I'm looking in the wrong place for the connection string.
I just found a connection string by going into Microsoft Visual Studio IDE. The properties for the connect there show this as the connection string: "Data Source=LENOVO\;Initial Catalog=GGTest;Integrated Security=True". This makes more sense to me as my server name is LENOVA and it references the correct database name.
The GGTEST.mdf file is in c:\Program Files\Microsoft SQL Server\MSSQL.10.MSSQLSERVER\MSSQL\DATA which is where it was created, by default, from within SQL Server. The program exe is in ...My Documents\Visual Studio 2008\Projects\WindowsApplication1\Bin\debug and in the same path ending with release.
Garth
|
|
|
|
|
Correction.
The application path is:
...My Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\Bin\debug
{see WindowsApplication1 twice in the path}
|
|
|
|
|
OK, then you're not using SQL Server Express, you're using a full version of SQL Server.
"Data Source=LENOVO\;Initial Catalog=GGTest;Integrated Security=True"
This string assumes that you have added your user account to SQL Servers users and have assigned the proper rights to get at your database. It also assumes that you really do want to use your Windows logon account as the account to login to SQL Server with.
The connection string you found would be better placed in your applications app.config file, not in the machine.config.
|
|
|
|
|
VB2008 did not create an app.config file for this project.
|
|
|
|
|
It never does. You have to add it yourself. You-click the project node in the Solution Explorer and click on Add...
|
|
|
|
|
Dave,
From Solution Explore (on the project node) when I add a local database it assumes that I want an SQL Server Compact 3.5 database. What I want to do is attach to a db created in SQL Server 2008 Developer. So when I reset to this as my preference I then get back to the same problem - this error message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Note: When I accept the Compact 3.5 option, the db is created and I can interact with it successfully from the database explorer.
Question: Does VB2008 Express limit one to using just a Compact 3.5 database?
Thanks so much for your continuing help on this.
Garth
|
|
|
|
|
I got through to tech support at Microsoft. The conclusion was that I am using VB2008 Express. Apparently the Express edition limits the capabilities that you have to interact with SQL Server 2008 Developer edition.
|
|
|
|
|
Hi all,
I'm working on an application, in which the first step is to append all files in a folder selected through FolderDialogBox.
It works perfevtly.
There is a change in the requirement now.
The change is, all .txt files within the selected folder and .txt files in the subfolders of the selected folder has to be appended.
Any help on this requirement witll be helpful.
Is there any posibility to upload my code in text file format?
If so please let me know, so that I can upload the code.
Its not possible to paste the code here, cos it has more number of line.
Thanks in advance.
modified on Thursday, October 8, 2009 6:40 AM
|
|
|
|
|
Don't bother uploading all your code, chances are no one will audit it for you.
As for your requirements, I'd advise you to take a look at recursion for navigating through a hierarchy of folders, you can use a List or another type of Collection to keep track of .txts before calling some logic to append them all to a new file.
|
|
|
|
|
Can you suggest any article for recursion?
I searched but could'nt get a good one.
|
|
|
|
|
You can make use of GetDirectories method to get all the directories under the top folder and then do as needed. One of its overload takes in SearchOption as parameter, use that one.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thanks for your suggestion.
Will checkout.
|
|
|
|
|
I used SearchOption.AllDirectories in my code and got my requirement done.
Dim theFiles As FileInfo() = theDir.GetFiles("*.txt", SearchOption.AllDirectories)
Thaks to all those who replied to my post.
|
|
|
|
|
hey everybody,
I've posted a question here before but didn't get much help.
I have a problem!
'//*/Macro:911;Tests:#ADSLCustomerClass;Generates:146,147
BeginMacro911 ADSL 04 Fehlende Angaben, remplace Macro-326 cye 07.07.2003
Case_#ADSLCustomerClass
"002" : Mtext 146
"2" : Mtext 146
Else: MText 147
EndMacro911
I was able o parse the first line with a friend and add 911 ADSLCustomerClass 146,147 successfully to my DB in Access
My question is how do I read the other lines?
the first line was read with strBuffer
|
|
|
|
|
Hawkster18 wrote: I have a problem!
Yes you do. You were given good advice, and instead of buying and studying a book on VB.NET, you have chosen to waste an entire week on reading the first line "with strBuffer" whatever that may be.
FWIW: reading a second line is exactly as hard as reading the first line.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
please don't get me wrong, but right now I have hardly any time to read a book...i come home from work...i'm home for 5 minute and i have basketball practise. I have 2 basketball games every weekend, sometimes even during the week. That's why I can't buy a book.
Look if you could just help me that would be great...why can't you guys help me?
I'm just asking a question...if you could explain it to me.
|
|
|
|
|
We can't help you because you're not helping yourselves.
Our lives don't revolve around doing other peoples work, some of us donate free time to help others with specific problems but we generally help those who help themselves. We have time constraints also, family, sports, a job, whatever. We still find time to research for specific problems, as a general rule most of us will not do your work for you.
Get a book. Read it between basketball practice and school, whenever. Everyone has time to learn, not everyone wants to..
|
|
|
|
|
Did I ever say that you would be doing the work for me?
I'm only asking for help.
let me show you quick ok
This Part:
'//*/Macro:911;Tests:#ADSLCustomerClass;Generates:146,147
Open strFile For Input As #intFile
Do While EOF(intFile) = False
Line Input #intFile, strBuffer
strID = Left(strBuffer, 5)
Select Case strID
Case "'//*/"
FirstArray = Split(strBuffer, ";")
MacNumber = Split(FirstArray(0), ":")
'~~> Macronumber
fldMacroNumber = MacNumber(1)
SecondArray = Split(FirstArray(1), "#")
'~~> Tests
fldTests = SecondArray(1)
LastArray = Split(FirstArray(2), ":")
'~~> Generates
fldGenerates = LastArray(1)
'~~> Add New Record
rs.AddNew
'~~> Get Field Values
rs!Macronumber = fldMacroNumber
rs!Tests = fldTests
rs!Generates = fldGenerates
'~~> Update Records
rs.Update
Case Else
End Select
Loop
with this code I can successfully transfer 911, ASDLCustomerClass and 146,147 to the specific databasetablefields
this is the full file which I have to read and transfer to the right databasetablefields:
'//*/Macro:911;Tests:#ADSLCustomerClass;Generates:146,147
BeginMacro911 ADSL 04 Fehlende Angaben, remplace Macro-326 cye 07.07.2003
Case_#ADSLCustomerClass
"002" : Mtext 146
"2" : Mtext 146
Else: MText 147
EndMacro911
I just need to know how to read the other lines and insert the right Information in the right databasetablefield.
I'm not asking for the correct code, I'm asking for help...like for example:
ok here's a small help or tip for you to start
code code code
nothing else!
|
|
|
|
|
Hawkster18 wrote: I'm not asking for the correct code, I'm asking for help...like for example:
ok here's a small help or tip for you to start
code code code
nothing else!
That's called 'doing your work while you sit on your ass and claim it as your own', which I do not do for people who don't help themselves. Your tone is rude as is your entire message.
I would rethink your attitude before replying, or posting again.
Again, help yourself. Go out, buy a book and work through it to have a better understanding of what it is you are trying to accomplish. When posting code, please use the <pre></pre> tags to make your code more readable.
|
|
|
|
|
OK,
can you give me an example of how I should post a question so that I can get an answer?
|
|
|
|