PDA

View Full Version : رفع اشکال در مورد اتباط با دیتابیس



مهدی رحیم زاده
دوشنبه 04 اردیبهشت 1385, 19:22 عصر
این کد رو نوشتم .


myda = new SqlDataAdapter("select * from book_sabt", sqlcon);
myds = new DataSet();
mydv = new DataView();
find_row = -1;
myda.Fill(myds, "book_sabt");
mydv.Table = myds.Tables["book_sabt"];
بعد روی خط پنجم این اشکال رو می گیره لطفا کمکم کنید و بگید چکار کنم .


An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

afarinn62
پنج شنبه 11 خرداد 1385, 07:11 صبح
sql adapter یه sql connection هم میخواد
dim con as new sqlconnection1("datasource=localhost")
my.connection=con