منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[VB.NET] wep application - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : [VB.NET] wep application (/showthread.php?tid=13086)



wep application - تناسيم - 31-08-15

اين يكتب ال connection code في web application باستخدام vb.net هل في صفحة ال aspx ام في موديول


RE: wep application - أبو عمر - 31-08-15

كود :
You can write it Webconfig, Class , Module, xx.vb, or  in page markup,
But  we have not Modules exist in Asp.ney items we need to create it
in webconfig your connection string will be like this
  <connectionStrings>
    <add name="MyConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=database;Integrated Security=True"
</connectionStrings>
*Add class 
rename it  module1
inside code change " Class1 to module1"
now ready to use 
Public Module Module1


End Module
* in xx.vb
            SqlDataSource1.ConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=database;Integrated Security=True"
*Markup we need type
<Script>
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
here our connection string like this 
   SqlDataSource1.ConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=database;Integrated Security=True"
end sub
</Script>

 
Best wishes