<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WinForms</title><link>https://www.dotnetzone.gr:443/cs/forums/12/ShowForum.aspx</link><description>Θέματα για rich client / windows εφαρμογές, σε οποιαδήποτε γλώσσα (VB.NET, C#, managed C++, κ.α.)</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Πρόβλημα με Attach Database σε C# library.</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/59244.aspx</link><pubDate>Tue, 22 Jun 2010 19:33:42 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:59244</guid><dc:creator>manosB</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/59244.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=59244</wfw:commentRss><description>Και πάλι όμως. Κάνεις connect στον Server χωρίς credentials. Δοκίμασε να του δώσεις.</description></item><item><title>Απ: Πρόβλημα με Attach Database σε C# library.</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/59239.aspx</link><pubDate>Tue, 22 Jun 2010 05:52:49 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:59239</guid><dc:creator>Τάσκος Γιώργος</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/59239.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=59239</wfw:commentRss><description>Εννοούσα ότι δούλευε σε ένα ASP.NET πρόγραμμα. Στο Windows Forms library που έκανα δεν παιζει.&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Απ: Πρόβλημα με Attach Database σε C# library.</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/59238.aspx</link><pubDate>Tue, 22 Jun 2010 04:15:59 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:59238</guid><dc:creator>manosB</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/59238.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=59238</wfw:commentRss><description>Κλασσικό πρόβλημα δικαιωμάτων. Ο χρήστης που προσπαθεί να κάνει connect στον sql server όταν το κάνεις από κώδικα είναι ο χρήστης που τρέχει το web application σου και όχι ο χρήστης που έχεις κάνει login στα windows. Λογικά είναι ο&amp;nbsp;&lt;span class="Apple-style-span" style="font-family:Tahoma, Arial, Helvetica;font-size:12px;"&gt;ASPNET&amp;nbsp;ή κάποιος παρόμοιος (δεν το έχω πρόχειρο τώρα)&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:Tahoma, Arial, Helvetica;font-size:12px;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:Tahoma, Arial, Helvetica;font-size:12px;"&gt;Άρα δώσε κατάλληλα credentials όταν προσπαθείς να κάνεις connect στον server.&lt;/span&gt;&lt;/div&gt;</description></item><item><title>Πρόβλημα με Attach Database σε C# library.</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/59237.aspx</link><pubDate>Tue, 22 Jun 2010 03:46:34 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:59237</guid><dc:creator>Τάσκος Γιώργος</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/59237.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=59237</wfw:commentRss><description>Έχω φάει αρκετή ώρα προσπαθώντας να καταφέρω να γίνεται Attach μια βάση δεδομένων από C# κώδικα.&lt;br&gt;Κάτι το οποίο με τον ίδιο τρόπο έχω ξανακάνει σε άλλο Web Project μάλιστα.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;                Server mServer &lt;span style="color:Red;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;new&lt;/span&gt; Server(Parameters.Config.ServerAddress);

                mServer.AttachDatabase(Parameters.Config.DbName, &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;new&lt;/span&gt; StringCollection { 
                    Parameters.Config.DatabaseMdfFile, 
                    Parameters.Config.DatabaseLdfFile }, AttachOptions.None);&lt;/span&gt;&lt;/pre&gt;Βλέπεται κάτι το περίεργο?&lt;br&gt;&lt;br&gt;Το Exception είναι:&lt;br&gt;&lt;br&gt;Failed to connect to server .&lt;br&gt;&lt;br&gt;Inner:&lt;br&gt;&lt;br&gt;{"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: Named Pipes
 Provider, error: 40 - Could not open a connection to SQL Server)"}&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Parameters.Config.ServerAddress &amp;lt;= .&lt;br&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Parameters.Config.&lt;/span&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;DatabaseMdfFile &amp;lt;= Full DirectoryPath + File Name&lt;br&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Parameters.Config.&lt;/span&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;DatabaseLdfFile &amp;lt;= &lt;/span&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Full DirectoryPath + File Name&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p&gt;Είναι Checked while debugged code.&lt;/p&gt;&lt;p&gt;O SQL Server έχει enabled TCP/IP, Named Pipes όπως π.χ. λέει και το Exception.&lt;/p&gt;&lt;p&gt;Όταν την κάνω attach μέσα από το Visual Studio όλα λειτουργούν κανονικά!&lt;/p&gt;&lt;p&gt;Έχω δοκιμάσει με το όνομα του Server...τίποτα. Δοκίμασα με καρφώτα plain string path filenames...μπα...&lt;/p&gt;&lt;p&gt;Όσον αφορά τα rights δεν μπορώ να καταλάβω γιατί να μην έχω δικαιώματα, admin του υπολογιστή είμαι.&lt;/p&gt;&lt;p&gt;Καμμιά ιδέα??&lt;br&gt;&lt;/p&gt;&lt;pre&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item></channel></rss>