.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

powershell invoke-sqlcmd adding semicolon

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
 
I've noticed that when i run a create  procedure script usinginvoke-sqlcmd in the  powershell for sql server or using the cmdlet that it appends a semicolon to the end of my procedure. I was wondering if this is by design and if there is a way to turn it off. If I run the same script in sql server manangement studio I don't get a semicolon at
 the end.
here's a  the test script I'm using:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create PROCEDURE [Facultative].[procFacApplicantImpairmentSelectPage]
(
  @sortOrder     nvarchar(500)
 ,@maxRowsPerPage    int = 20
 ,@startRowIndex    int = 1
 ,@totalRows     int output
 ,@RowStatusId     nvarchar(50) = null
)
AS
 begin
 RETURN @@ERROR
 
END



View Complete Post


More Related Resource Links

adding a SharePoint content source using powershell

  
Hi I'm trying to create a content source using powershell and (I'm not a programmer) I've got this far -   [System.Reflection.Assembly]::Load("Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Sharepoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") $site = new-object Microsoft.SharePoint.SPSite("http://breakfast/ssp/admin") $searchContext = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($site)  $content = new-object Microsoft.Office.Server.Search.Administration.Content($searchContext) $Content.ContentSources; --> and now I'm stuck! I think I can use the Create method with type and name parameters but I can't work out how to translate this into powershell This is the code I'm looking at: ContentSource contentSource_com = content.ContentSources.Create(typeof(WebContentSource), "www.someurl.com"); WebContentSource webContentSource_com = (WebContentSource)contentSource_com; webContentSource_com.StartAddresses.Add(new Uri("http://www.someurl.com/index.html)); webContentSource_com.Update(); and $contentsource = $content.ContentSources.

Adding SharePoint PowerShell snapins

  
Hello All, I am new to both working with PowerShell and Servers originally performing more frontend development. That said, I am now working with SharePoint Srever 2010 of which is installed on Server 2008 (non-R2 version). I have PowerShell installed however every time I want to run Backup, Restore commands I am alwasy having to add: Add-PSSnapin Microsoft.SharePoint.PowerShell. Is there a way to permanantly add this snap in so I don't have to add it every single time? is there a way to permanantly add any and all sanpins so I don't experience any unrecognizable cmdlets? Don't want to make others angry but I amnot seing what all the praise is about in PowerShell at the moment.

How to invoke c# function from another project without adding reference?

  

Hi,

There is a C#.net libraray project whose dll name is customer.dll. It has a class name customer with a function name show(). I want to call this function from another project but dont want to add reference to the caller project. Can this be done? Is there any C#.net class that can acheive this?


Problems adding AD Security Group to SP Group using PowerShell

  

I am trying to create a powershell script that will enumerate SharePoint 2010 permissions and groups from a .csv file. The script needs to

1) Create the SharePoint groups
2) Add an owner
3) Add an active directory doman security group
4) Add a permission level to the SharePoint group.

However, I can't seem to add active directory groups to the SharePoint groups even though the groups exist in SharePoint, as they have been imported through the UPS synch.  This is the code I have been using:


param (

 

    [string] $createspgroups = "SPGroupssh.csv"

 

)

$web = Get-SPWeb http://myserver

 

ipcsv $createspgroups | foreach {

$owner = $web.AllUsers[$_.Owner];

$adgroupname = $web.AllUsers[$_.ADGroupName]; 

$GroupName =$_.GroupName; 

$web.SiteGroups.Add($GroupName,$owner, $adgroupname, $GroupName) 

$memberGrp = $web.SiteGroups[$GroupName] 

$web.AssociatedMemberGroup = $memberGrp 

$memberRole=$_.Permissions

$memberAssignment = New-Object Microsoft.SharePoint.SPRoleAssignment($memberGrp)   

$memberRoleDefinition=$web.RoleDefinitions[$memberRole] 

$memberAssignment.RoleDefinitionBindings.Add($memberRoleDefin

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Adding Search Refinements in SharePoint 2010

  
I have been playing around with SharePoint 2010 Search this morning. I love the new UI. The search refinements panel is just begging to be messed with. In my case I wanted to add the file extension JPG as an Image Type refiner.

Adding Client-Side Confirmation When Deleting

  
The JavaScript confirm(string) function displays its string input parameter as the text inside a modal dialog box that comes equipped with two buttons - OK and Cancel (see Figure 1). The confirm(string) function returns a Boolean value depending on what button is clicked (true, if the user clicks OK, and false if they click Cancel).

Enterprize library 4.1 getting output parameter after adding record in db, plz guide

  

Hi,

I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide

Thanks


dynamically adding sql server columns based on number of files in fileuploader

  

I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

 

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

 

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")

objConn.Open()

Adding the table row below a particular row.

  

What is the best method in jQuery to add an additional row to a table as the row below a particular row?


Adding new items to a Repeater control with transitions?

  

Hi,

I am currently in the process of writing a facebook type 'activity feed' for a site. Currently I am binding the last 10 items to a repeater control, which contains a usercontrol representing each item. This works fine but there are a couple of requiremnts that are giving me problems and wondered if the the good people of the forum could make some suggestions.

The requirement is that when a user clicks a refresh button any new events are added to the top of the list, the previous items drop down and the equivalent number of old items drop off the bottom, all with nice slider transitions.

I have put the repeater inside of an update control and are able to handle the transitions by using RegisterStartup script to drop jquery calls onto the page for the slider. However I cannot find a way to dynamically add or remove new datarows to the repeater. I need the old items to stay in the repeater and be pushed down by the new items, so completely refreshing the datasource seems like a bad idea.

I was thinking about maybe storing the datasource in the viewstate and adding rows to that, maybe with an extra column on the end which stores what transition is needed on the databind for my jquery, but there will be a 'View more items' link at the bottom of the page, so I am worried that the list could get pretty large and there

adding a url to html img

  

I am having an html img tag in which the user is being shown images. However I now want to open a url when the user clicks my img. 
What do I need to do to be able to achieve this? 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend