Linked Servers +Microsft SQL Server, Excel, Access (Ms-Access)

Linked Servers + Distributed Queries

Linking to External Data Sources

Following stored procedure will allow you to create a link to another SQL Server. Link server name would be “SECOND”

EXEC sp_addlinkedserver

@server=‘myservername’,–name you will be using to refer link server @srvproduct = ‘Excel’, –Product name i.e excel @provider = ‘Microsoft.Jet.OLEDB.4.0′, –Jet engine

@datasrc = ‘c:\myexcelfile.xls’, –Excel file path

@provstr = ‘Excel 8.0′

To view the linked servers on your mchine or Server You can use following Query. SELECT [Name], Product, Provider, Data_source FROM sys.servers WHERE Is_Linked = 1; To Drop a linked server EXEC sp_DropServer @server = ‘Nyack’; Distributed Security and LoginsEXEC sp_addlinkedsrvlogin @rmtsrvname = ‘MyServer\SECOND’, @useself = ‘false’, @locallogin = ‘HPPRESENT\total’, @rmtuser = ’sa’, @rmtpassword = ‘password’; Linking with ExcelEXEC sp_droplinkedsrvlogin ‘MyServer’, NULLEXEC sp_DropServer @server = ‘MyServer’; EXEC sp_addlinkedserver @server = ‘Argo’, @srvproduct = ‘Excel’, @provider = ‘Microsoft.Jet.OLEDB.4.0′, @datasrc = ‘C:\Path\Myfile.xls’, @provstr = ‘Excel 8.0′EXEC sp_addlinkedsrvlogin @rmtsrvname = ‘MyServer’, @useself = ‘false’; Linking with Microsoft AccessEXEC sp_DropServer @server = ‘MyServer;EXEC sp_addlinkedserver ‘MyServer’, ‘Access 2003′, ‘Microsoft.Jet.OLEDB.4.0′, ‘C:\SQLData\MyAccessDatabase.mdb’;

I Wan to share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • kick.ie
  • Live
  • MyShare
  • IndianPad
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • DotNetKicks
  • DZone
  • TwitThis

User control in asp.net + java script + validation

I created a user control for Countries using Microsoft Visual sutdio. I populated a dropdownlist ( Server Side ) using database and then I called this countrol in one of my web form. I wanted to validate this User control but it was not validating when I used ”MyControl1.ClientID”  instead of this when i Use Asp.Net generated ID it worked. Can any one tell me why It happend.?<script type=”text/javascript”>

function textlen(source,arguments){var textlen=document.getElementById(“<%=TextBox1.ClientID%>”).value; var country=document.getElementById(‘ctl00_ContentPlaceHolder1_Country1_DropDownListCountries’).value; if (country==“Select a value” && textlen.length==0){arguments.IsValid=

false; return;}}</script>

This is my user control id  “ctl00_ContentPlaceHolder1_Country1_DropDownListCountries” Javascript was unable to get User control Id by using the following line

var country=document.getElementById(Country1.ClientID).value;

 Does any one  know why?




I Wan to share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • kick.ie
  • Live
  • MyShare
  • IndianPad
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • DotNetKicks
  • DZone
  • TwitThis