Survey: Including SQL In App Code Or Only In The DB / Procs?
Jan 22, 2009
Trying to start a discussion on what approaches forum members take when faced with the issue of writing code that calls SQL queries upon a DB. Do you tend to always put SQL in stored procedures and call the proc (and does that include basic CRUD operations) or always the opposite? Or do you prefer a mix of some procs and some coded sql? If its the latter then how do you determine which queries go where?I imagine the scale of a project can dictate some of the possible answers. I've done both and sometimes I find that quick and dirty apps that have little chance of changing or are easy to modify do not need procs. On the other hand, I generally will choose the mixed option where anything other than CRUD (i.e. workflows) will be sent to a proc. I have a particular interest in hearing about your experiences with larger projects (i.e. 100+ tables in the DB) that employ a Domain Model approach to a layered solution (has distinct UI, business, and data access layers.) However I'm interested in responses to all sizes and shapes of projects.Opinions?
View 1 Replies
ADVERTISEMENT
Feb 1, 2011
I'm new with VB programming and would like to know if anyone can look/test this code I have written. I don't have the ability to test right now because I'm at work and can't get VB installed on my desktop. This program is supposed to display the amount of gross pay for employees based on their weekly sales (if $5000 or more times 9% + $200) while using a one dimensional array.
View 2 Replies
Sep 18, 2010
My boss has asked me to set up DotNetNuke's Survey Module and make a few custom changes to it for a client. But I'm having trouble just getting the bare-bones code to run properly!Downloaded both the source & install folders from [URL] Created a new VB Web Application Project Took out all the default pages Copied the Survey source code into the VB Web Application Project in exactly the same structure Made a batch script that creates an installation folder identical to DNN's install folder (double-checked by running a folder-diff on it, and all files/folders were identical) Zipped up my installation folder using 7-zip The source code compiles perfectly. But even though the files/folders are identical, DNN's zipped package will work properly on my DNN site, and my own zipped package will fail with this famous error message:
Error: Survey is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Could not load type 'DotNetNuke.Modules.Survey.survey'. --->
[code]....
View 7 Replies
Aug 25, 2010
creating the DNN Survey Module from source code
View 5 Replies
Jan 26, 2010
I have used CLR stores procedures in SQL server for awhile now, but I'm still wondering what the best situations to use them are.MSDN provides some guidelines for use like heavy string manipulation (regex), or replacing T-SQL that declares lots of table variables and cursors.I'm curious to know what problems SO users are solving with CLR stored procs, and examples / benchmarks as well.
View 5 Replies
Jun 19, 2012
I'm new to the .NET platform (old-time ASPer) and for a project have a simple pair of .aspx scripts that take some querystring data and process it. They both make use of the same Subs, Functions in them, so naturally I'd like to move the code to a common resource.vb file. Having done some reading, it looks like my options are a Code-Behind type setup, and placing the Subs, Functions in a .vb file and placing that file in App_Code.So, the Code-Behind model doesn't seem to make sense here, as the functions are shared by both files. Placing the Subs and Functions in /App_Code/resources.vb and I am getting the following error when trying to call any of the routines:
View 2 Replies
Oct 25, 2011
I'm working with system using Linq-2-SQL as its data layer, but which uses stored procedures to do the actual CRUD operations - the stored procs are configured against the CRUD methods for the data class in the model designer.These are all working just fine.Now we want to use partial classes to extend the functionality of our data classes to apply validation, and hold parsed versions of some of the database properties.
However when I create a partial class for one of the data classes, the datacontext stops using the methods configured against the dataclass and defaults to its own operations. This happens even if the partial is empty other than the just the class declaration.
I would guess that this might be because the method signature for the insert method stops tying up to what the datacontext is looking for, but I can't see any overrides available to help fix it.Is there a way around this so that I can use Partials and Stored Procs on the same data context?
View 1 Replies
Apr 17, 2011
I am developing an ASPX web page to return results from two SQL stored procs via VB. When I execute these two stored procs, they both return valid data. But for some reason, when I run this report it doesn't return any errors, however, it doesn't return any records/data either!
Also, I can't debug it for some reason, although I can set breakpoints! This is using VS 2008, but I think reason I can't debug is I believe this is a limited version that just works for SSRS and SSIS.
[Code]...
Could the problem be due to the fact that this web page uses the same SQL connection for both stored procs? The first proc should be returned initially, and the second proc after this screen. So I don't need both stored procs information simultaneously, so I would think I could reuse the same SQL connection.
OK, I found where the problem is located. If I just comment out the Level statement in the Where clause, it does return data. So only thing I changed was that one line in my SQL code and it works. This means missing data must be due to datatype incompatibility, no? What is the problem?
View 2 Replies
Mar 28, 2011
A company pays its salespeople on a commission basis. The salespeople receive $200 per week, plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Develop a console program (using a one-dimensional array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson?s salary is truncated to an integer amount):
a)$200-$299
$300-$399
c)$400-$499
[code]....
My gross salary formula works fine but im confused about my For Next Statement. Not sure if im doing it right. i forgot one thing.... i'm not sure if my increment counter should be where i put it. I think it needs to be in my for next statement?
View 9 Replies
Feb 22, 2011
I have a user control form with two text boxs, three radio buttons, and a text box for a description, but i need help trying to lik together and when the user hits the send button it sends it to a email,
View 5 Replies
May 13, 2012
I'm currently quite new to VB and am trying to create a multiple choice questionnaire for work. This is a depression survey in which there are 23 groups of statements with 4 options per group. Every time a patient clicks an option, the next set of 4 questions comes up on the screen.
I'm trying to convert the old VB4 code into the new VB 2010 code. Before we were using a control array and the code looks a little something like this[code]...
View 2 Replies
Feb 24, 2012
i know it could sound as a silly question but i was wondering if there's a way to get data from a survey on paper though: i mean, let's say i have a survey on paper with questions and some checkbox that the user will tick and i want to get its data scanning the document and save it as pdf, if it's possible, or jpg or doc, whatever. Then with PHP or whichever language you suggest, try to get the data in some way from the scanned document and put it to a DB.
View 2 Replies
Nov 15, 2011
I have to create a cafeteria survey application. Twenty students were asked to reate, on a scale of 1 to 10, the quality of the food in the student cafeteria, with 1 being "awful" and 10 being "excellent." Allow the user input to be entered using a ComboBox. Use an integer array to store the frequency of each rating. Display the frequencies as a bar chart in a list box.
I can get the comboBox and everthing, but it's not displaying the bar chart.
Here is my code.
Public Class Form1
'String array stores ratings
Dim ratings() As String = {"1-Awful", "2", "3", "4", "5", "6", "7", "8", "9", "10-Excellent"}
Dim studentCount As Integer 'number of student ratings entered
Dim frequency(9) As Integer
[CODE]...............................
View 1 Replies
Sep 14, 2009
I am planning a three form checklist/status report for a FEED template. Each form will address a different FEL. FEL1 is really a simple checklist and is easily dealt with using the Windows Form. My question is there a better structure to handle the more complex FEL2 and FEL3, like the web page? FEL2 will have approximately 20 questions and FEL3 will have about 50. I am still undecided whether to use radio buttons (radio button list, which I do not understand yet) or text boxes that will take a value between 0 and 10. I may weight the questions to give an overall percent complete that I can show on the progress bar or some such. If there is a better structure than the Windows form, can it and the Windows Form be linked? If not, will abandon efforts to complete current FEL1. Conceptually, you cannot start FEL2 until you have completed FEL1, and FEL3 until FEL2 is complete.
Public Class FrmFEL1
Dim PctCmpt As New ProgressBar()
Private Sub CboxChrtr_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboxChrtr.CheckedChanged
[CODE]...
This is what I have so far. It is no working at all. No values appear when boxes checked. Would like a value for each checkbox that can be added in in order to get a total. That total to be added to the percent complete (TxFEL1).
View 13 Replies
Jul 7, 2010
I am working on a program that takes data from a survey in the program and needs to compile it into a PDF file. Optimally it would just be a snapshot of the filled out survey. I tried using the PrintForm component in the PowerPacks section, but I need a PDF not an EPS.
View 1 Replies
Jun 24, 2010
You know how you can put a picture in the resources file and it will be included with the exe. I was wondering how could i get a video to be apart of my program so that I would have to carry the video around.
View 1 Replies
May 17, 2009
I'm writing a class-library in VB.Net and one of the subs that are being called from the application which is using my library has more or less the following syntax:
Public Sub LoadDict(ByVal PhoneticType As String, ByVal strDict As String)
where PhoneticType can be phonSoundex, phonDoubleMetaphone or noPhonetic
I want to give the application-developer a possibility to select the PhoneticType from a list when writing the call of above sub (I think it's called attribute-arguments). This would make it easier for the developer since spelling-errors can be avoided and which will avoid errors when using the library. I think it's all about attributes but I haven't managed to get it to work despite trying.
View 1 Replies
May 7, 2012
I am looking to create a gridview with an add button to have the user be able to insert a new blank row. I am also looking for this row to be able to have checkboxes as fields.
View 1 Replies
Mar 24, 2009
I am trying to have a user input 7 letters into a textbox, and then have a url like "[URL]". Basically I am needing for the seven letters to be included in the custom url.
View 2 Replies
Jan 6, 2009
I am compiling and deplying my program on CD. I am using the PAINTSTROKE font in my program. This font is not on everyone's computer. How do I tell VB 2005 IDE to include it? I assume this would work with any font that may not be on another computer.
View 3 Replies
Dec 9, 2009
I'm using a dll in my program, it works fine. But when I publish and try to run on another machine, it says the dll is missing.Am I right in saying that I need to add it to my references, with the Add button on the references page? When I do that, it says it's not a valid assembly or com component.
How do I fix this? My level of knowledge is very low, especially with dll's.
View 10 Replies
Mar 3, 2012
I have created a form that should allow user to communicate with the database. The search criteria are filled withing Textbox. Then the string from the textbox is transferred into the SQL Command string. However, it is not included...
SQLStr = "SELECT * FROM tblMain WHERE ID = " & txtSearchBox.Text & "'"
MsgBox(SQLStr)
And only this part is stored in SQLStr variable = "SELECT * FROM tblMain WHERE ID = " - (pops up in msg box)
View 7 Replies
Dec 10, 2010
Is there anywhere I can add folders to my project, so when someone downloads my project/program they automatically get the files I added into it. Say I want to include a data file, and my program automatically uses that file for my RichTextBox1 - And everytime they save, it saves to that file - And when they open up the program again, it opens that automatically preloaded file that came with the program?
View 1 Replies
Feb 17, 2010
I need to include a text file that I host on a website, into my program. I'm not sure if you can do this, but I need to. What specific code, or object (with code) should I use, to do this? Version Used: Microsoft Visual Basic 2008 Express Edition
View 6 Replies
Jul 7, 2010
I am trying to "behind the scenes" log myself into a website, from the VB code behind my ASP.NET website. But I am dumbfounded as to how to do this.
As far as I know I should be using the WebRequest or Webclient class. That is about as much as I know. I am not sure how to use the class.
I want to click a button on my website and have its Click event send a username and password to another website. This other site isot affiliated with mine. I realize the concept may seem stupid, but I plan on taking this further later, but Just need to know this now.
View 1 Replies
Apr 20, 2010
I have 2 source codes in fortrran (I have not written them). I visualized these codes by linking them to VB2005.when I excuate the VB.exe, when VB calls one of these DLLs, there is no problem, but in calling the other DLL, the DLL is executed but the VB.exe is closed and the interface page to the user goes out.
View 1 Replies
Jun 28, 2009
faster way to enumerate through a directory and sub-folders to gather all the files in the enumeration? This is what I have right now:
Public Shared allFiles() As String
allFiles = Directory.GetFiles(<ServerLocation>, "*.*", SearchOption.AllDirectories)
EDIT: I am enumerating these files from a server location. I don't know if that will change the perspective of this question or not.
View 4 Replies
Feb 19, 2009
I've tried searching for a way to get a list of all files + all files in all subdirs. I've tried a simple shell("dir /s /b > myfile.txt") but it doesn't work because of some Danish specific characters. I have looked at the "getfiles" method, but I can't get it to work
View 4 Replies
Jun 22, 2010
I'm writing a program that gathers a list of files within a directory and optionally, every file within the subdirectories (10 levels deep) of the directory then exports it as a text file. I have no idea how to do this so I just attempted to code it myself.
It works by gathering a list of every subdirectory within the selected directory and their subdirectories, so on and so on and adds them to a listbox. Then to gather the list of files I used a for each to get the files within the subdirectories but it shows "(Collection)". After exporting it shows " System.Collections.ObjectModel.ReadOnlyCollection`1[System.String]".
How can I make this code work? I think I could've done this much easier a different way but I need the full path included.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
ListBox1.Items.Clear()
Dim FolderBrowserDialog1 As New FolderBrowserDialog
[code]....
View 1 Replies
Apr 28, 2009
I follow a "new" book called "Programming Using Visual Basic 2008 7. edition" by David. L. Schneider.
But when I was creating a file called " PAYROLL.TXT " it didnt show up in the debug folder as it should. How do I get the file automatic located in the debug folder?
If first question is answered:Second question - is it the same way to include other files?
View 5 Replies