.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

First Time Creating a StoreProc; Not Working Very Well...

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server

I am trying to create a StoreProc to sweep data from a .csv file, saved on a network drive, to a Table, in SQL Server.  I’m kind of new to SQL Server, and need a little help with this task.  I thought this link offered a good suggestion:



So, I created my StoreProc; it looks like this:

-- ================================================

View Complete Post

More Related Resource Links

Dynamically creating Gridview Template - Linkbutton Click not working



I have written some code to dynamically generate template columns for gridview which works well. However, each cell in the gridview has to be a linkbutton, which when clicked does a db update and redirects to a specific url with some parameters in it.

I have attached a click event handler to the linkbutton in the InstantiateIn method but the event does not seem to fire.

Could someone please help? the code is below -

//Dynamically creating the Grid

protected void btnAnalyze_Click(object sender, EventArgs e)

can anyone tell me why setInterval is not working properly i want to display the time every seconds,

setInterval is suppose to execute the script every second there getting the most uptodate time of day , but it does not update it stays the same
      <script type="text/JavaScript">

          function interval() {
              setInterval("time()", 1000);
          function time() 
              var d = new Date();
              var time = d.getHours();
              var time2 = d.getMinutes();
              var time3 = d.getSeconds();

              document.write(" : ");
              document.write(" : ");
  // -->
      <input type="button" OnClick="interval()" value="Click Me!"/>


Delete not working all the time.

From time to time i am getting this error when attempting to delete a file. Exception Details: System.IO.IOException: The process cannot access the file 'D:\gallery\images\Untitled-1.jpg' because it is being used by another process. And the times i see it most is if i upload the image and then within seconds try to delete the image. Is there anything that can be done on my part to help prevent this? 

"Remember Me Next Time" under Login Control is not working

I am using VS 2005 and created a Login control. Login control provides "Remember Me Next Time" check box, I check this box but it does not remember next time. I have following entry in the web.config file <authentication mode="Forms"> <forms name=".MyCookies" loginUrl="login.aspx" protection="All" timeout="5000000" cookieless="UseCookies" slidingExpiration="true" path="\"></forms> </authentication> What am I missing? Thanks

Previous working date - Time dimensions


Hi all,

I need an mdx to get the previous working day. 

I`ve got my complete time dimension, including weekends.  Every day member has got a Member Property that says wether it is a working day or not.  See table below.  Then, I need an mdx expression to return the "Prev working Day".  Any idea??



day of the month IsWorkingDay Prev Working Day
01/09/2010      1

Creating a timer job which runs only once at a specific time



I want to create a timer job which runs only once at the 'specified date and time'. How to create the job? Should i delete the job after it runs?

Visit SharePoint User group - India



I am facing the following error:

"Hotfix installer has stopped working" when i try to install the MS SQL Server 2005 update using Windows Update.

My OS is MS Vista Ultimate version


Please help.


Thank you


working with 3 dropdownlists at a time


i am using 3 dropdownlists namely state, city,zip. Once we select  "state" dropdown list ,that state contained "cityes" are displayed.and "cityes" dropdown list selected that city contained "zip" values are displayed.Once we selected state in state dropdownlist,that state contained cyties are displayed at cities dropdownlist. then we want to select another state again we select another state at that time state dropdown box display doplicate values. The duplicate values are comming in run time. how will over come from this duplicated values in drop down list. please help me...

Configure Navigation Inheritance at the time of creating the site


Hello All,

I am creating new site in my web application with the template team site. While creating the site I have to click More Option and select the "Yes" for "Use top link bar from the parent Site?" So Is there any way to set it default yes. It is set as "No" default, I want to change it "Yes"...


Can you please help me out to get the scenario solved???

Thanks in Advance.

Question on Creating Aggregations based on Time data in a Cube



I have a fact table that lists projects and the site visit dates that related to those projects.   For each site visit date there are a number of associated KPIs.

However to make life a little bit more complicated these KPIs are prorated by year so for each site visit there may be several rows in the fact table that relate to each year ie 2005,  2006 etc...

The issue I am having is that I have been given a requirement to view each KPI at the site visit level.   My first idea was to create an aggregate table for each site visit with totals for each year ie  2005 sales total,  2006 sales total etc...    The issue is that totals can be for any year between 2005 and 2014 and clearly creating all these hard coded totals means there will be a huge number of KPIs required with in-built time logic at the site visit level ie for each KPI I would need a separate measure for each possible year.

Any other alternatives?   The underlying fact table will of course show the end user a list of site visits and the KPIs relating to each year,  but the end user wants to be able to view the data in a repivoted format so that site visit returns 1 row with the prorated date columns appearing vertically across.   For the time being I cannot see that this is possible without having a huge agg

Creating Functions and Displaying the time in C++


Ok, How would I be able to display time in a form for C++? I just need the time not the date though and I need this to appear in a label. I saw the Visual Basic code but couldnt find the one for C++.


I am making a test and I want to have different test versions...My second questions is how can I create a function for every test version and depending on the checkbox, it does what is inside a certain function?

For example:

void TestA()


label->text = "Question 1: NaCl";

if (textbox->text = "sodium chloride")

return 0;

How would I turn this into a Windows Form Function and just call it when someone presses a checkbox.


My very last question is, how can I simplify my code for checking if a answer is correct? I want to give the test taker two tries and if they dont get it right on the third, I want it to display the answer...

I have tried loops, and writing out the complete code, but it is too messy. Does anyone k

Why for the first time my call to web service is not working


Hi ,

I have a web service hosted on windows 2003 server.

When I make a call to that web service for the first time its returning 'xml response not well formed', but from second time onwards its working fine. Again to solve this problem I removed all my soap header and everything that i suspected but its still showing the same error for the first time when i tried to call any method of the web service.


can you please suggest me what should I do ?


Cube Writeback with weighted allocation working strangely - creating large negative values against f




I've got a cube (2008) with 2 MGs: Actuals and Budgets.

The Budgets partition is Write-Enabled.


On Excel 2010 the user will select the Actual Date for 2010-07, and will set the Budget date to 2011.

After seeing what the YTD actual figure looks like he enters the budget for 2011.

It is supposed to take that budget figure and split it between the funds that have actuals against them (using weighting).


Here's the problem:


SSAS allocates inflated figures against those funds, and then, so that the sum of those values will equal the originally entered amount, it puts a large negative value against the first Member in the fund dimension (I experimented with this by deleting the first member in that dimension. It just allocates the negative value against the new member!).

Why isn't it just allocating the values based on the ratio that it gets from that Actuals calc?



The UPDATE statement on the trace looked like this:


UPDATE CUBE [Forecasting]
SET  (
        [Actuals Date].[Year-Quarter-Month-Day Hierarchy].[Calendar Year Month].&[2010-07]
        , [Budget Date].[Year-Quarter-Month-Day Hierarchy].[Calendar Year].&[2011]

How to minimize time when creating 2005 merge replication with very large data files and log files?


Dear all,

We're using window server 2003 sp1 + sql ent 2005 sp2 with merge replication between 2 servers. Since 1 of server sql is down, we need to create merge replication again. However, our data file size is 60Gb and log size is 40 GB and when we create merge replication it may need more than 10 hours to finish which is unacceptable since when creating replication the online db normal service operation may be affected. Is there any other way that can reduce the replication creation time within 5 hours to finish? Thanks a lot.


P.S: we are using full recovery model and plan to change to simple recovery model. Any help?




Creating / Working with Custom Forms in Visual Studio


This is what I *want* to do, but am not sure of best practices, etc:

I create and deploy my lists from Visual Studio. I now want to modify the default dispForm for the list. Open Sharepoint Designer, make all of the desired changes in my display form (eg link to another list and display related items). Now I want to get that form into Visual Studio so that I can deploy it as part of my solution.

Tried viewing generated code in Sharepoint Designer, and bringing it in to the schema.xml of my list, in the <form> section, wrapped in CDATA - that didn't go.

Tried saving my entire site (with custom form) as a package, saved .wsp, renamed to .cab, opened, grabbed modules/elements.xml and opened. Pulled out the custom form section (<File Url="myForm.aspx">...</File>) and added it into a module under my list instance. Referenced it from the <forms> section of schema. Like:


While Activity for creating multiple tasks not working


I am using a while activity for creating multiple tasks for a workflow. The code is executed fine and the task is created when the loop runs only once. But when the loop runs twice or more, only one task is getting created. Also the WF status shows as Error Occured.

All I want to do here is create multiple tasks (no of tasks depends on an entered column value) for the same user. Is it posible to use 'while' in this scenario? Or is there any other way to go ahead?

NB: I am using state machine workflow. 

Calculating working time


I have a project to calculate the time duration for each employee each day he get inside the site. the data coming from 2 linked database. the duration should be calculated from alarm event table any time the employee access one of dedicated gate. I have add a sub-query on my root query to aggregate the clocking-in and clocking-out. The case give ’01’ as clocking-in and ‘02’ as clocking-out.

Now what is missing is calculating the duration time each employee worked each day provided that he/she might clock-in and clock-out several time a day or he/she might work on shift between two day. 

please help me complete my attached script

 CardHolderTable.FirstName + ' ' + CardHolderTable.LastName AS [Emp. Name],
 ViewSMSCardHolderPersonalData1_25.[Personal Data 2] AS Department,
 ViewSMSCardHolderPersonalData1_25.[Personal Data 3] AS [Job Title],
 ViewSMSCardHolderPersonalData1_25.[Personal Data 5] AS [Company Name],
 ViewSMSCardHolderPersonalData1_25.[Personal Data 6] AS [Projec
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