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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Snapshot creation problem

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :Sql Server


On  this code which has been provided by Alok I get an exception at the statement marked below. The exception message is also provided. The strangest thing is that the Snapshot IS created. The original DB is NOT read only but the snapshot is.

public void CreateSnapshotAlok ( string SourceDatabaseName )
            ProvideSecurity.provideSecurity ( );
            DoServer.GetSrvConnOrSwitch ( "master" );
            /* This is to ensure that a database with same name does not exist which is not needed if one chooses unique name for snapshot each time.*/
            if ( Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ] != null )
                Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ].Drop ( );

View Complete Post

More Related Resource Links

Symbol.Keyboard.KeyPad() object creation problem

on windows mobile 6.5 application running on Windows mobile 6 professional VGA emulator. I am trying to work on keyboard functionality like function key press events. I have coded the below line.   Symbol.Keyboard.KeyPad keypad = new Symbol.Keyboard.KeyPad();   keypad.KeyStateNotify +=new Symbol.Keyboard.KeyPad.KeyboardEventHandler(keypad_KeyStateNotify); keypad.AlphaNotify +=new Symbol.Keyboard.KeyPad.KeyboardEventHandler(keypad_AlphaNotify);   Its build successfully but raising exception at runtime. please help me out to run this code on emulator. because i don't have device.

problem with sitemap schema 'xsi:schemaLocation' in XML file creation

SqlConnection conn = new SqlConnection(connStr); conn.Open(); string sql = "select top 10 catnum,cast(case when isnull(onhand,0) < 5 then 0 else round((onhand/2),1) end as int) as onhand from dbo.V_OnHand with (nolock)"; SqlCommand cmd = new SqlCommand(sql, conn); XmlDocument doc = new XmlDocument(); XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null); XmlElement rootNode = doc.CreateElement("inventory"); doc.InsertBefore(dec, doc.DocumentElement); rootNode.SetAttribute("xmlns", "http://seller.marketplace.tests.com/inventory/v1"); rootNode.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); rootNode.SetAttribute("xsi:schemaLocation", "http://sellersupport.domain.test.com/test1/s/schema/inventory/inventory-xml-feed-v1.xsd"); doc.AppendChild(rootNode); XmlElement fbm = doc.CreateElement("inventory"); doc.DocumentElement.PrependChild(fbm); SqlDataReader rdr1 = cmd.ExecuteReader(); while (rdr1.Read()) { XmlElement item = doc.CreateElement("item"); item.Set

Dynamic Text Boxes Creation Problem

Hi all, I am creating 5 textboxes in a row. A new creates when user press enter in the last textbox. I have taken a hidden text field and in OnKeyDown of last textbox I am assigning the combination of last textbox Id with the table count  to the hidden field and in VB Code I am checking whether the tableCount + Last textbox Id is equal to the hidden field or not then only I am generating the new row. here is the code In JavaScript On KeyDown of remarks textfield. function funcNewRow(id,count,e) {    var e = event || evt;    var charCode = e.which || e.keyCode;    if(charCode == 13){      e = cancelKey(e);      htxtBox.value = id + count;    } }   In VB Page_load method calling getTableRow() method   if htxtBox.value = "remarks" & (Tbl.Rows.Count + ViewState("TotalClearedItems")) Then  Tbl.Rows.Add(GetTableRow(Tbl.Rows.Count + 1 + ViewState(Panel1.Controls.Add(Tbl))  Panel1.Controls.add(Tbl) htxtBox.Value = "" end if   Here I have to implement a clear functionality such as each row at last contains a check box when user click the check box and press clear button the checked rows have to deleted .   The clear button code as follows : cnt = CInt(Tbl.Rows.Count)  For i = cnt To 1 Step -1 c = Pag

Report Server Project DataSet creation problem


I am getting an error while trying to create a dataset in SSRS.


"An error occurred while loading the query designer 'OLEDB-MD'. Only text based query designer will be loaded."


The "Query Designer" command is getting disabled.


FYI: I was able to create successful connection while created the shared DataSource to the AS db, which I used to create my dataset.


Please guide me in getting through this error..


Thanks in advance


Problem with site creation by applying custom site template


Hi All,


 I am trying to create a sharepoint teamsite with the custom features such as teamsocumentlibrary, teamtasks, teamdiscussions, teamAnnouncements, teamevents, teamslinks. When I try to create I alwys get "#140001: The parent of the page, sps/teamspace/Freigegebene Dokumente/Forms/AllItems.aspx, is not in the structure store." I can't understand this my onet.xml is starts with <Project Title="$Resources:onet_TeamWebSite;" Revision="2" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint" Url="sps/teamspace"> and all the lists has the Url startswith "sps/teamspace/listName". 


Does anyone have any idea. If I try to create a site with another sitetemplate it works fine. 


I can't find more information about this in google as well. Any expericens please help.



Thanks in advance.

Problem in cube creation


Following the link, http://www.sqlcoffee.com/AnalysisServices_0001.htm

i successfully did finished with the project using Adventure DB.

But when tried to make a cube using other DB, its not succeeding.

Like , during the creation of Cube, the main fields including key fields used to link tables were not appearing in the 'Select Measures' page.

Ex. there are 6 tables.

Invoice, InvoiceRow, Customer, Items, CustomerGroup, ItemGroup.

The links are like 

Invoice.InvNum = InvoiceRow.InvNum

Invoice.Cus = Customer.Code

InvoiceRow.Item = Items.Code

Customer.GrpCode = CustomerGroup.Code

Items.GrpCode = ItemGroup.Code

the following fields are not appearing in the measures list,

Invoice.CusName, Invoice.InvNum, Customer.Name, CustomerGroup.Name, Items.Name, ItemGroup.Name.


Is there any where im going wrong ??

Please Advice....


--------------------------- Radhai Krish | Golden Age is no more far | --------------------------

Single User MySite Creation problem

Yeah... So I left the company I work for about 8 months ago, and came back to it about 2 months ago.  During my absence, my teammates deleted my AD account (as they should have).  Let me preface this by saying that MySite creation works for everyone else but me.

When I click on MySite I get the create My Site page, I can choose my language, but after pressing OK, I get this error:  "There has been an error creating the personal site. Contact your site administrator for more information."

I'm really not sure where to start on this one...  And am willing to give up quickly and just rename my account.  Does anyone have any ideas before I go that route?


Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

RaiseEvent problem


I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.

UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.

First I created the sub delegate and event in UC1:

  • Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
  • Public Event Refresh_UC1 As MyRefresh

In the same UC1 the Insert procedure that fires the insert and RaiseEvent:

Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
       Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
       Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
       myCom.CommandText = "AddRow"
       myCom.CommandType = CommandType.StoredProcedure


Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



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