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

Top 5 Contributors of the Month
Post New Web Links

t-sql advice

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server

I am new to sql server programming, and would like some advice on how to loop through a table and run a function for each row. As a VB programmer I would use a recordset or datareader to loop from beginning to end with

while datareader.read


Is there something similar in t-sql?


View Complete Post

More Related Resource Links

New off line application working with sdf file. Need advice


Hey Folks

I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.

Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's



Need advice on starting ASP and eCommerce programming

hello group,I'm about to start implementing an e-commerce using ASP.NET and C#. However, I'm moving from PHP to .NET platform, of course in past have done C# programming. I have few questions;Where to start? is only ASP.NET that I need to catch up with or other topics as well?How can I use an e-commerce template i.e. nop-commerce or ... such that I can write/read to/from a different database other than MS SQL Server?How can I learn to tie nop-eCommerce with my ASPX pages ? is there any reference that I can use to learn it or is it part of the documentation which come with online store API?Thanks in advance.

Any advice on stopping the follwoing hacker (Meher Assel)

 Hi, All    I a have just logged into my hosting provider and all 3 of my sites have been hacked by the same perspn (Meher Assel). Has anyone came across this person before and any advice on how to stop it. All it looks like has been done is files created in my directoty saying I have been hacked on my hosting provider. Many Thanks Kered

Please Advice SQL 2008 Standard Edition

·         I have a issue with subscriptions since we have SQL 2008 Standard edition and i found out that Data Driven Subscription are disabled. We have about 100 reports subscribed by our internal & external customers. I have a DB "Prices" In that we have 4 Tables, Analysts,Users,SalesReps & Sub Sales rep the subscriptions are by anyone and everyone from these 4 tables.... we have a Project thats in Build in sql server 2008, which is a repository for all our 100 reports....basically what we are trying to do is based on Relationship, security level and user hierarchy they can access the reports... Any ideas will help ???????????FM

Seeking Advice for Implementing Document Library Functionality

I have an assignment to implement a mechanism in WSS 3.0 to deliver files from a document library as PDF when the user selects a particular file.  I have a third party tool for PDF conversion which I can use to do the conversion, and I have put together some C# code for the API that does what I need as far as that goes. Where I am having trouble is deciding how to implement this in Sharepoint.  The multiple steps involved in kicking off a workflow would confuse many users, especially those not used to Sharepoint.  I would like to find a solution that would involve a single click on the chosen document. I know my way around ASP.NET, but Sharepoint is less familiar.  I am not afraid to jump in, and am not asking anyone to write code for me, but I am trying to get traction on the Sharepoint road.  I would appreciate any thoughts others have as to a direction I might take. Thanks.

Advice needed on backup strategy and implementation

This is my plan: Full database backup is performed at 5AM every day. Then log backups are taken every 30 minutes starting from 5:30AM till 11:30PM What I want to achieve is to have all backups for the same day to be contained in the same file on the disk. That is on Feb 18 2010 file c:\db_backup_02_18_10.BAK will be created at 5AM with full database backup. All backup logs that occur on Feb 18 will be appended to the same file. Next day c:\db_backup_02_19_10.BAK will be created at 5AM. Is this "correct" approach? The reason I like it is that everything needed to restore to any point in time for specific day is contained in one file and can be copied easily to a different computer. I tried to achieve this result via Maintenance Plan wizard by creating one task for full backup (scheduled once a day at 5AM) and another task for log backup (scheduled every 30 minutes starting from 5:30AM till 11:30PM) (both tasks are in the same maintenance plan). This, however, saves result from each job in a separate file called $DBNAME_backup_YYYY_MM_DD_HHMMSS_NNNNNNN.trn (for transaction log backup; will probably have extension .BAK for full backup) Can this even be done via Maintenance plan? I think I can achieve desired result via SSIS where I can generate file name programmatically and pass it as a parameter to "BACKUP DATABASE ..." or "BACKUP LOG ..." stat

need advice on a schema

I've inherited an ancient Access database that I've migrated to MS SQL. Have a question about how to improve a particular table.The table contains records for lodging establishments. Each row represents a particular establishment, and there are dozens and dozens of columns. Among these columns are over a dozen that name various activities available in the area where the establishment is located. Each activity has its own separate column, and the values are set to true or false. I sense there is a better way to handle this.The table will be queried with a web form, and among the form components will be checkboxes for each of these activities. What would be the best schema for the table? Should I create another table for activities (each activity being a row), and join it to the original table?Or is there a smarter way to handle this? I have not been asked to make any changes but this seems like a good opportunity to improve the database (and learn some things myself about how to design a relational database properly). Here's the schema of the existing table (I've imported it from Access into SQL 2005 but haven't altered anything yet): USE [maineinns_staging] GO /****** Object: Table [dbo].[MaineInnMembers] Script Date: 08/25/2010 14:31:45 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[MaineInnMembers]( [ID] [int] NOT NULL,

Need advice to control Privileges based on User

I'm a WinForm beginner. My main form is frmMain.cs Once user logged, frmMain.cs will display a menu based on User. This menu represent in button. Let's say, if User=System Admin then 3 button appear. if User=Master Agent Administrators then 5 button appear and so on How to control that? Really need advice If there's another way, please let me know

Advice on Data from Data - SQL VB.NET

Could on I get some advice on how to properly write / retrieve, in VB.NET / ASP.NET Page,  from SQL. It's not so much the 'writing' part for SQL that I am worried about.  I'm having some trouble retrieving data properly. I have a routine that runs each time the page is loaded, or an insert is performed (2 button, virtually the same process), post back occurs. When the page loads getTheSavedData - could be empty (recordSet) display 1 Record (recordSet) - that is based upon the getTheSavedData or lack there of   My difficulty is that, my second recordSet isnt getting the parameters expressed from the first recordset.  The saved information has an impact on the 2nd recordset / query. It can more or less be summarized in this Procedure. (excuse the clutter, I've been working with a few things, trying to display it on screen for myself)Private Sub a1TrialData() Dim a1IDCBDsaved As Integer = 0 Dim a1IDPBDsaved As Integer = 0 Dim a1IDCBDremaining As Integer Dim a1IDPBDremaining As Integer Dim SQLCount As String = "SELECT * FROM MER_ASS_QA WHERE U_ID = " & _ Merit3.passVariables.AUIDp & " AND A_Priority = " & _ Merit3.passVariables.aPriorityP & "AND TRIAL_NUM = " & _ Merit3.passVariables.aTrialNumP Dim strSQL

advice needed on implementing a re-usable class (c#)

Hi guys,Im trying to create a function for my website that allows the re-sizing of images for different purposes. I want the function to use variables for image height and image width, and obviously for the file itself. I have working test code for re-sizing a selected image that is hard-coded into the function. I have created it in a separate class in my App_Code folder, and have tried calling it on web pages and it works until I try and pass a filename as a variable, encountering a variety of errors. Should I be using a server control/user control to do this? or do I need something else?RegardsPooleo

Need advice to display data in DataGridView, then edit dan save the data

I am Winform Beginner. To display data using DataGridView is ok with me. How the best way to select row in DataGridView, then edit and save. Did this DataGridView can editable? or Once row in DataGridView is selected, then popup another form to perform edit transaction. Really need advice and good example

Multiple customer architecture advice

Hi I am setting up a SharePoint application that will be run from a data center for multiple customers. Each customer will be provided with a core set of SSRS reports managed by our organisation along with some document libraries containing pre-formatted web part pages. There will be a relatively small amount of other SharePoint content primarily associated with product documentation. Each customers application needs to be partitioned to use a separate database and security. The security will be implemented with forms authentication. As a prototype I have created a master site (port 80) with sub-sites for each customer. My assumption was that this would make it easy to manage shared content. I am however concerned about how to secure each customer to their own sub-site and prevent them from having access to the master site (it is there in the breadcrumb links on many pages). Is a multiple site approach the right way to go about this job or should I be looking at other architectures?Andrew Wiles - www.it-workplace.com - MDX made simple

Advice on collecting data in a time series

Hi everyone,  I just wanted to get some ideas of what you would think be the best way to collect data/numbers that are part of a time series?  Let's say I'm collecting monthly data from the users, related to some product and I'd like to be able to provide them a simple and efficient way of entering these numbers based on some month end period.  So for instance on 6/30/2009, they could enter some numbers for a set of data points that pertain to that product.  Would one of the data controls (such as GridView or DetailsView) be sufficient to do this?  I know the GridView isn't so much able to save data but I believe the DetailsView has some functionality for that. In the end, I'd really like to provide a seemless way to do show this and ability to enter and save this.  Any ideas would be appreciated.Thanks

Need advice on index

Hi, If I need to add an index for a varchar column in a table/view, what type of index do I need to use i.e. clustered or non-clustered?Thanks, Sam

Need advice on preformance (web service returns list items on 20000 rows list)

Greetings I need to write a web service that will return sharepoint list items (default web services of sharepoint are no use to me since they just suck when the site is not in english).  Since we have lists with 20k+ items, the return xml might get large. Query web service did manage to do it, yet it took some time to output the xml with those 20k rows.  I am affraid that my custom made web service will preform poorly since it wont be "native" to sharepoint. I am asking for your judgement, did i fell into common pitfalls or something or is there any way to improve preformance of my code? My own web service code looks like this:   [WebMethod] public XmlDocument GetListItems(string siteurl, string listguid,string querytext,string rowlimit) { InitSchemaExporter(siteurl); SPQuery query = new SPQuery(); query.RowLimit = rowlimit.Length==0?10:Convert.ToUInt32(rowlimit); query.Query=querytext; return SchemaExporter.GetListItems(listguid, query); } public void InitSchemaExporter(string siteurl) { SchemaExporter.SetSite(siteurl); SchemaExporter.IgnoreField = ConfigurationSettings.AppSettings["IgnoreField"].Split(new string[1] { "\r\n" }, System.StringSplitOptions.None).ToList<string>(); ; SchemaExporter.IgnoreList = ConfigurationSettings.AppSettings["IgnoreList"].Split(new string[

SQL Server Database Engine cannot obtain a LOCK resource - Advice VERY welcome

Since about 07:47 this morning (which is why I fired up a web browser running several programs which used databases on this server) I have been seeing the following error: Event Type: ErrorEvent Source: MSSQLSERVEREvent Category: (2)Event ID: 1204Date: 14/10/2009Time: 10:54:23User: CD\REMOTESERVER$Computer: SQLSERVERDescription:The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.Data:0000: b4 04 00 00 13 00 00 00 ´.......0008: 09 00 00 00 43 00 4f 00 ....C.O.0010: 4c 00 4f 00 53 00 53 00 L.O.S.S.0018: 55 00 53 00 00 00 06 00 U.S.....0020: 00 00 53 00 55 00 53 00 ..S.U.S.0028: 44 00 42 00 00 00 D.B... I ran through the guidance provided, but we cap memory use at 16GB and the server is not using more than 5GB. I looked at current locks and no process was using more than 4, a total of about 110 all told. We don't cap connections, indeed we pretty much run with the default SQL settings. The only issue I can see relating to SQL was a failed patch attempt Event Type: ErrorEvent Source: Windows Update AgentEvent Category: Installation Event ID: 20Date: 14/10

Looking for advice

I have a Gridview with six columns:ddlGrade - dropdownlist {A,B,C,D,U,W,I}, written to the database onselectionchanged autopostbacklblStudentname - label {student's name}lblStudentID -lable {student's ID value}lblClass - label {student's class designation (SR,JR,SO,FR,GR, etc.}txtLastDateAttended - textbox {hidden unless a grade of 'U' is selected ddlGrade}cbxDidNotParticipate - checkbox {hidden unless a grade of 'U' is selected from ddlGrade}I want to force the instructor to enter either txtLastDateAttended or cbxDidNotParticipate at the time a grade of U is given and before another student't grade (ddlGrade) can be selected.My initial thought was to see if I could disable all instance of ddlGrade when a new value of 'U' is chosen but 1) I am have been unable to figure how to do that yet and 2) I'm hoping someone here can offer a better way.Best, Travis
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