Hi All,
I am totally new to databases. I am starting from the absolute beginning. I want to learn MS-SQL and was wondering how/where to start. I need info on everything from installation and set-up on an Windows XP PC to programming in SQL. Is there a book or website that can guide me. I am fairly decent at programming and am able understand technical books. Installation and set up are my main concerns right now, since I believe that once I have a stable system to learn on, SQL should be easy.
Thanks!
I like to use impersonation using multiple databases and a user with no login.
I'm working with Powerbuilder 10. I can change users using the command Execute Immediate "EXECUTE AS USER = 'username'". Unfortunately, I can't execute the command 'REVERT' from Powerbuilders Execute Immediate command. The Execute Immediate command prefixes the 'REVERT' command with a exec. ie. exec REVERT.
I thought I could encapsulate the REVERT command in a procedure and run the procedure using Execute Immediate. But, I'm new to SQL Server and I'm not sure if I can.
Does anyone know how to solve this problem? Thanks.
Hi I have double checked my code and cannot pin down why I am getting the error "There is already an open DataReader associated with this Command which must be closed first. " on the lne: Line 95: DR_IndJobPostings = oComm_IndPostings.ExecuteReader(); I have closed the DR_IndJobPostings object after every use of it as see n on line number 175
----------- Code--------------1 /// <summary> 2 /// Will generate and email job alerts based on the frequency 3 /// </summary> 4 /// <param name="frequency">WEEKLY or MONTHLY</param> 5 /// <param name="oServerIN">Instance of Server from ASPX page</param> 6 public void hk_DoAlertByFreq(string frequency, HttpServerUtility oServerIN) 7 { 8 SqlConnection oConn = new SqlConnection(ConfigurationSettings.AppSettings["CString"]); 9 oConn.Open(); 10 11 SqlCommand oComm; 12 13 emailSystems oEmail = new emailSystems(); 14 HttpServerUtility oServer = oServerIN; 15 16 bool validCall = false; 17 bool industryHasPostings = false; 18 string sEmail = ""; 19 string sEmailTemplate = ""; 20 string sVacListForEmail = ""; 21 22 int IJPost_VacId = 0; 23 int IJPost_EmpId = 0; 24 string IJPost_Req = ""; 25 string IJPost_KeyRes = ""; 26 string IJPost_VacTitle = ""; 27 string IJPost_VacJobTitle = ""; 28 string IJPost_VacUrl = ""; 29 30 int loopCounter1 = 0; 31 32 string CandEmailAddress = ""; 33 34 oComm = new SqlCommand(); 35 oComm.Connection = oConn; 36 oComm.CommandType = CommandType.Text; 37 38 SqlCommand oComm_IndPostings = new SqlCommand(); 39 oComm_IndPostings.Connection = oConn; 40 41 SqlDataReader DR_Industries; 42 SqlDataReader DR_IndJobPostings; 43 SqlDataReader DR_AlertList; 44 45 if (frequency == "WEEKLY" || frequency == "MONTHLY") 46 { 47 validCall = true; 48 } 49 50 if (validCall) 51 { 52 if (frequency == "WEEKLY") 53 { 54 sEmailTemplate = oEmail.readTextFile("/email_templates/weeklyJobAlert.txt"); 55 } 56 57 if (frequency == "MONTHLY") 58 { 59 sEmailTemplate = oEmail.readTextFile("/email_templates/monthlyJobAlert.txt"); 60 } 61 62 sSql = "" + 63 "SELECT [id],[industry] FROM S_Utils_Industries " + 64 "WHERE [active] = 1"; 65 oComm.CommandText = sSql; 66 DR_Industries = oComm.ExecuteReader(); 67 68 if (DR_Industries.HasRows) 69 { 70 // 71 // Loop through each active industry 72 // 73 while (DR_Industries.Read()) 74 { 75 industryHasPostings = false; 76 iCurrentIndustryId = (int)DR_Industries.GetSqlInt32(0); 77 sCurrentIndustryText = DR_Industries.GetSqlString(1).ToString(); 78 79 // Get all active vacancy postings for this 80 // industry 81 sSql = "SELECT [id]," + 82 "[emp_id], " + 83 "[vac_Requirements]," + 84 "[vac_KeyResp]," + 85 "[vac_VacTitle]," + 86 "[vac_VacJobTitle]," + 87 "FROM [S_Vacancies] " + 88 "WHERE [vac_VacIndustry_Id] = " + iCurrentIndustryId.ToString() + " AND " + 89 "[status] = 1 AND " + 90 "[vac_ListingStart] >= '" + gf.SqlDateTimeFormat(DateTime.Today,1) + "' AND " + 91 "[vac_ListingEnd] < '" + gf.SqlDateTimeFormat(DateTime.Today, 1) + "'"; 92 93 oComm_IndPostings.CommandText = sSql; 94 95 DR_IndJobPostings = oComm_IndPostings.ExecuteReader(); 96 97 // 98 // If there are job vacancy postings for the industries 99 // 100 if (DR_IndJobPostings.HasRows) 101 { 102 industryHasPostings = true; 103 sEmail = sEmailTemplate; 104 105 // 106 // Loop through the job postings for this industry 107 // 108 while (DR_IndJobPostings.Read()) 109 { 110 IJPost_VacId = (int)DR_IndJobPostings.GetSqlInt32(0); 111 IJPost_EmpId = (int)DR_IndJobPostings.GetSqlInt32(1); 112 IJPost_Req = DR_IndJobPostings.GetSqlString(2).ToString(); 113 IJPost_KeyRes = DR_IndJobPostings.GetSqlString(3).ToString(); 114 IJPost_VacTitle = DR_IndJobPostings.GetSqlString(4).ToString(); 115 IJPost_VacJobTitle = DR_IndJobPostings.GetSqlString(5).ToString(); 116 IJPost_VacUrl = "http://www.mann-power.net/vJDetails_FromFront.aspx?vid=" + IJPost_VacId.ToString() + "&from=myjobs"; 117 118 sVacListForEmail += IJPost_VacTitle + @" 119 120 Job title: " + IJPost_VacJobTitle + @" 121 122 Key Responsibilities 123 " + IJPost_KeyRes + @" 124 125 Requirements 126 " + IJPost_Req + @" 127 128 " + IJPost_VacUrl + @" 129 130 ============================================================ 131 132 "; 133 } 134 135 136 sEmail = sEmail.Replace("{VACANCYLIST}", sVacListForEmail); 137 138 // If there are job postings for this industry 139 // get all the people who signed up for a job alert 140 if (industryHasPostings) 141 { 142 sSql = "SELECT [S_JobAlerts].[IndustryId]," + 143 "[S_JobAlerts].[candidateEmail] " + 144 "[S_Cv_Status].[Cv_Online], " + 145 "[S_Cv_Status].[usingShortResume], " + 146 "[S_Cv_Status].[iHasHadIntro] " + 147 "FROM [S_JobAlerts] " + 148 "INNER JOIN [S_Cv_Status] ON " + 149 "[S_Cv_Status].[user_id] = [S_JobAlerts].[candidateUserId] " + 150 "WHERE ([S_JobAlerts].[frequency] = '" + frequency + "') AND " + 151 "[S_JobAlerts].[IndustryId] = " + iCurrentIndustryId.ToString() + ""; 152 153 oComm.CommandText = sSql; 154 155 DR_AlertList = oComm.ExecuteReader(); 156 157 // If there are candidates who signed up 158 // for a job alert 159 if (DR_AlertList.HasRows) 160 { 161 // 162 // Loop through each job alert for this industry 163 // 164 while (DR_AlertList.Read()) 165 { 166 CandEmailAddress = DR_AlertList.GetSqlString(1).ToString(); 167 oEmail.sendSingleMail("john.cogan@staffmann.co.za", "Mann-power Job alert", sEmail); 168 } 169 170 } 171 DR_AlertList.Close(); 172 173 } 174 } 175 DR_IndJobPostings.Close(); 176 177 } 178 179 } 180 DR_Industries.Close(); 181 182 183 oConn.Close(); 184 } // END: if (validCall) 185 186 }
I have a utility server that I am running SS2K5 SP2 w/ the latest patches.
It has numerous Linked Server to both SS2K and SS2K5 servera already in place and working great.
I scripted out (numerous times) a Link Server create statement for a SS2K5 server that is working great and then changed the server name in the script to reflect the new server name and executed it.
It DID created the linked server BUT when it finished up it generated the following message:
================ ERROR TEXT BEGIN ======================
TITLE: Microsoft SQL Server Management Studio ------------------------------ "The test connection to the linked server failed." ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "DC:AUS02DB21". OLE DB provider "MSDASQL" for linked server "DC:AUS02DB21" returned message "[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (PreLoginHandshake()).". OLE DB provider "MSDASQL" for linked server "DC:AUS02DB21" returned message "[Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error. Check your network documentation.". (Microsoft SQL Server, Error: 7303) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------
============= ERROR TEXT END ==============
Now when I try to open the Catalogs object under the newly created Linked Server, I get the following message each time I try to open it:
================ ERROR TEXT BEGIN ======================
TITLE: Microsoft SQL Server Management Studio ------------------------------ Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "DC:AUS02DB21". (Microsoft SQL Server, Error: 7303) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------
============= ERROR TEXT END ==============
Here is the code that I used as a template (and which is from a SS2K5 server that is working fine)
Now I have masked the real values in this post of the @provstr string for obvious reasons and the real Linked Server object has all the correct parameters set.
I have an issue with an SSIS package I was hoping to get some commentary on.
I am taking a flat file, scrubbing it in SSIS, and exporting it into a different package.
The files are fixed width. Both Fixed Width, and Ragged Right settings are not working, I've tried both.
My current config on the flat file connection is set to use the file name as variable. The format is "Ragged Right". The Text Qualifier is "<none>". The Header row and Header rows to skip are <CR><LF> and 0. The column names in first row are not checked.
In the advanced tab, 43 columns are defined. The output and input have all been verified numerous times to conform to the file spec.
When previewing the file in preview, only one record shows up even though the file contains multiple.
What it's doing is the last column contains the CR and LF characters and then it continues putting the other rows in that column (it is ignoring the CR LF and not going to the next row)
WHen I click on "Columns" in the flat file connector, it displays the rows of information as it should. When I click back down to preview a second time, the rows are displayed as they should.
The initial time you preview, the rows are jacked up and all smashed onto the first row. WHen trying to execute the package, I get a truncation error because the last column is supposed to be 7 in length, and contains multiple data rows in it.
When trying the option "Fixed Width" it does the same thing. It ignores the CR LF and makes everything one row.
Can someone please explain what it is I'm doing wrong? Or why when I click to preview the first time it is broken, but when clicking on columns and then back to Preview it is fixed?
Not sure if this is exactly the place to post this, but here it goes anyways.
I am writing a ASP.Net/C# program and I am interacting with a MS Access database in order to derive data on user login and logout times. Basically, I am trying to create a line graph that will display the number of users over the course of a user specified timespan. Currently, I am doing this by look at the number of users that were logged on during each minute of the timespan.
My database table setup consists of a EmployeeID column (Text), Logon Date (Date/Time), and Logoff Date (Date/Time). I have also created an index on the Logon Date and Logoff Date columns.
In order to view the number of users during a minute of the timespan I use a Jet SQL query of the following format
Code Snippet SELECT DISTINCT Count (EmployeeID) AS [User Count] FROM ProgramName WHERE ([Logon Date] < #August 27, 2007 11:45:00# OR [Logon Date] Is Null) AND ([Logoff Date] > #August 27, 2007 11:45:00# OR [Logoff Date] Is Null)
The problem is that using this method I have to execute 1,440 queries for each day in the timespan. Currently this takes about 25 seconds to execute if the timespan is a full workweek (7,200 queries).
Now the question. Is it possible to create a SELECT statement that will return user counts for multiple minutes? Like maybe a SELECT statement that returns a column of counts for every minute in an hour? If it is possible, does anyone have any examples? I am hoping by lowering the number of queries my program has to execute I will also cut down the time required for the code to run.
I am pretty new to SQL, so any guidance or advice is very appreciated.
I've got a Select query that pulls out some data from my database. Two of the columns are both booleans (bit's of size 1) so they come back as TRUE and FALSE - which I thought was fine.
However, the users are wanting to see YES and NO since they find TRUE and FALSE confusing (yes I know how silly that sounds).
Is there any way I can do this?
My query is like this: SELECT [stuff], [things] FROM [table1], [table2] WHERE [table1].[condition] = [table2].[condition]
I've had issues where backup up and restoring data from sqlserver2005 does not reattach the data to the correct users. Any tips on how to best accomplish full database moves where data is owned by different security users? thanks,
Hello everyone! Many thanks in advance for taking the time to help me out. I’ll also apologize upfront for the longwinded email, but I seem to be really stuck in a rut. I've been writing web apps for 3+ years in ASP and am finally taking the leap into ASP.net (a bit behind the curve, i know). I have a few books and have gone over the tutorials on this site. I am realizing that the syntax (if using VB) is much the same, but also realize how much richer asp.net is in comparison to traditional ASP.
I'm having some major issues in my learning process that stem from using the tutorials and attempting to be efficient with VS2003. I feel as though I’m missing something fundamental that could be causing my problems. My area of focus right now is data access, using connections, adapters and datasets.
The tutorials on this site show all of the examples by hardcoding the data access into the ASPX page. The tutorials have me importing the proper namespaces for data and sqldata access at the top of the page. This seems to work fine and dandy if I were to be coding my pages from a standard text editor, but I would like to use the richness of the VB.NET studio gui to expedite my work.
My first problem lies if I try to manually code the data access in the private class defined for the page in the codebehind section. Because it will not allow me to import multiple namespaces, the only way I get it to work would be to include the complete namespace for the object I’m trying to use (ie: system.data.sqlclient.sqconnection). On top of this, the datasets I define aren’t available as options when I try to bind them to objects in the GUI.
On the flip side, I tried to use the SQLconnection, Dataadapter, etc objects in the gui, but I can’t seem to find where the code is dynamically written for these, nor how I can, for example make this sort of connection use an application-variable level connection string. The only way I can see to make this would be to define the connection for each web form, which seems silly when I’m trying to deploy each solution multiple times with different databases.
I apologize for my ignorance, as this is probably fairly simple to overcome. If someone could point out what I’m doing wrong, or point me in the right direction, I’d be very appreciative. I am sick of spinning my wheels with this, and keep getting tempted to go back to using traditional ASP, just so I can get my job done.
I was just looking for opinions on the best place to pick up SQL skills. Community college course? Online courses? Grad school? I've finished undergrad, if that helps anyone have an idea of my current situation.
I can't get a script to run that's supposed to generate a QueryParameters dialogue to take inputs and then run the query - forexample, the following.. . .and fl.flow_name = [[TRUE][FLOW NAME][@?]].. . .generates SQL Query Analyzer exceptions about "Incorrect syntax near'FLOW NAME'.Suggestions?
I have several DTS packages I need to move to SSIS. I am having trouble understanding the new tools available and how I translate my lookup and ActiveX scripts into the new format. I feel like I just need a jump start to get me on the right road. Does anyone have any good suggested links to get me started with the new technology and get my head unstuck from the old DTS?
I am an experienced web developer using PHP and MySql have experience with VB.
What is the best way for me to learn programming pocket pc's? Is using sql server mobile the best offline database to use as I will be using MySql Compact framework to connect direcly to our Linux server.
Any help is much appreciated as I can't seem to find any useful tutorials on quering an sql databse to update, insert, read or delete. I have created a datebase however, I just don't know how to use it.
Hi: AS a newly Master degree graduate student in IT field. My M.S. degree training has been emphasized in database developer, Web developer, Web/database developer, network, and network and computer security. My personal interesting are database and web. have experienceon java servlet and database(create a web site), try ASP and dataabase now, but I don't have any work experience(come from other country and change major)
hope can get advice from kindness prople what is suitable to learn DBA or oracle ? conside about difficult level, cost, and suite for future job market
I would like to learn to write SQL scripts to use with SQL 2000 and would like a good reference. I read the book "SQL Queries for mere mortals" and that was a start, but really didn't provide me enough depth to write the complex scripts that I need. Idealy something that goes into the programming logic like PL/SQL in Oracle did. Basiclly, if I had something that would allow me to interperet some of the scripts I see on Swynk so I can modify them to meet my needs, I think that would be a great place to start.
I know oracle SQL, now I need to do a lot of SQL query on Microsoft SQLSERVER, can any one point out any place that I can find out the syntax of SQLserver SQL statement? Since this is just a short term assignment, so I don't want to buy a book, just hoping I can learn something quickly from online. I don't need learn anything deep, just need to know some simple syntax so I can do join, count, concatenate, min(), max(), sum () etc.
Hi there I sorry if I have placed this query in the wrong place. I'm getting to grips with ASP.net 2, slowly but surely! When i try to access my site which uses a Sql Server 2005 express DB i am receiving the following error:
Server Error in '/jarebu/site1' Application.
Database 'd:hostingmemberasangaApp_DataASPNETDB.mdf' already exists.Could not attach file 'd:hostingmemberjarebusite1App_DataASPNETDB.MDF' as database 'ASPNETDB'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Database 'd:hostingmemberasangaApp_DataASPNETDB.mdf' already exists.Could not attach file 'd:hostingmemberjarebusite1App_DataASPNETDB.MDF' as database 'ASPNETDB'.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
This is the connection string that I am using: <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;Initial Catalog=ASPNETDB;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings>
The database is definitly in the folder that the error message relates to. What I'm finding confusing is that the connection string seems to be finding "aranga"s database. Is it something daft?
My department is switching from a TM1 database to an SQL Server database. With TM1, only a few people had the software necessary to run queries installed on their PCs. Whenever I needed data, one of these people would run the query for me and then I would perform whatever analysis is required. Now however, we all have MS SQL Server (Query Analyzer, Profiler, Enterprise Manager, etc.) installed on our machines and will be able to run our own queries.
I have no prior experience with SQL (my only programming knowledge is with Excel VBA) so I bought the "Teach Yourself SQL in 10 Minutes" book and worked through most of it. I practiced writing queries in MS Access, and feel somewhat comfortable with the language. However, when I try to do anything with SQL Server, I feel kind of overwhelmed with all of the options. I assume that I should be writing and executing my queries from Query Analyzer, but I find the object browser and everything confusing. Also, I'm not sure if I'm even able to create my own database to practice with. It seems like I can only connect to my department's server. Is there any way to work "offline" with a database on my own hard drive?
All of the SQL Server books that I've found seem to be either for DBAs or developers. Anything geared more toward beginners isn't SQL Server specific. Can anyone recommend an appropriate book for me?
Dear Experts,I've worked with Oracle since 1995. I have gonevery deep into many of the Oracle features, includingsqlloader, and export/import. And I've done datamodelling even longer.At the same time, I have done ETL since 1995.Although, at the Proc, and PLSQL, sqlloader, level.Map the data. Take data from the source, do anymodifications/transformations that are required,and insert or update. Easy. The hard part isdetermining the mappings.But I have not been given the opportunity towork much with ETL tools such as:Informatica, DataStage, Ascential, Ab InitioThe little bit of experience that I do have,showed that Informatica was -incredibly- easy to use.It's a GUI. It's SUPPOSED to be simple!!!I have missed out on a number of opportunitiesbecause I didn't have a few YEARS of experiencewith ETL tools. Which seems odd, because thetool looks like it requires a max of a week to learn!Just how difficult are these ETL tools to learn?Especially if you have already been working withOracle, and doing data mappings and loads since 1995?I'm thinking that it can't be difficult at all.When you search for newsgroups, there are no newsgroupsfor these tools. Although the companies who makethem, might have their own newsgroup.There are also not many books on these tools.If you search for books on Oracle, or SQL Server,you will find a lot of very big, and detailedbooks. But there is next to nothing specificallyon the various ETL tools.Any certifications for any of these tools lookto be much simpler than Oracle's.To me, the real issue is the mappings. If youcome into a new environment, the data mappingsare completely esoteric to those systems.No amount of experience with an ETL tool, or anytool, is going to tell you what the mappings should be.Questions:- Just how difficult are these ETL tools to learnfor an experience Oracle pro like myself?- Other than a GUI, making everything simple to use,just what are the advantages of using ETL tools?- what built in functionality do ETL toolshave, that can't be done in PLSQL?Thanks a lot!
Hi there,I have learned to create very, very basic queries at work, but I wouldlike to expand my knowledge. I live in Northern California, doesanyone know of any good schools and/or literature that could help mein this quest?Thanks a bunch,Juana
I'd like to learn SSIS working with SSAS, how to transformation data for Dimension or fact tables? What are different between normal ETL tasks and ETL for Dimension / fact tables ? How to learn? Do I need to learn SSAS first? Please give tips for that. Many thanks.
Hello.I would like to learn all the possible ways that we can access and modify data in ASP .net 2.0 programmatically.for example one way would be like this: StringBuilder sql = new StringBuilder();sql.Append(" SELECT *"); //count the total number of recordssql.Append(" FROM dbo.tblJobTitle "); //get the connection string from web servicesstring strConnection = new sqlconnection.SQLConnection().GetSQLConnectString(sqlconnection.SQLDSN.SCIC);//Use the Microsoft.practices SqlDatabase object to execute our sql.SqlDatabase SqlHelper = new SqlDatabase(strConnection);SqlDataReader reader = (SqlDataReader)SqlHelper.ExecuteReader(CommandType.Text, sql.ToString());the i can loop through reader and get the data OR I can create a DataSet like this: SqlDatabase db = new SqlDatabase(strConnection); DbCommand dbCommand = db.GetSqlStringCommand(sql.ToString()); DataSet dst = db.ExecuteDataSet(dbCommand);I want to know if there is a comprehensive book explainaning all these possible ways to access and modify data using C# under ASP .net 2.0I really really apreciate this.Thank you very much.
does anybody know where I can learn how to add, update, delete using SQL datasource control? I have a couple of books that shows me how to SELECT but nothing shows me how to update, add new record or delete with the SQL data source control. Even this website doesn't have any tutorial. Does any body know where I can read up on how to use all features of this control? Or where that have a couple of examples on how to use it?
Learn Oracle Database Administration in 10 Minutes. No kidding. Checkit yourself,http://www.takveen.comOnly good analogy makes complex concepts simple!
i want to learn about the meanings of the different 'data types' in VS 2005 (database) i.e. 'nvarchar(50). could you please advice me of a good site (reference) to read.
In my SQL Server Management Studio Express (SSMSE), pubs Database has a Stored Procedure "byroyalty":
ALTER PROCEDURE byroyalty @percentage int
AS
select au_id from titleauthor
where titleauthor.royaltyper = @percentage
And Table "titleauthor" is: au_id title_id au_ord royaltyper
172-32-1176 PS3333 1 100
213-46-8915 BU1032 2 40
213-46-8915 BU2075 1 100
238-95-7766 PC1035 1 100
267-41-2394 BU1111 2 40
267-41-2394 TC7777 2 30
274-80-9391 BU7832 1 100
409-56-7008 BU1032 1 60
427-17-2319 PC8888 1 50
472-27-2349 TC7777 3 30
486-29-1786 PC9999 1 100
486-29-1786 PS7777 1 100
648-92-1872 TC4203 1 100
672-71-3249 TC7777 1 40
712-45-1867 MC2222 1 100
722-51-5454 MC3021 1 75
724-80-9391 BU1111 1 60
724-80-9391 PS1372 2 25
756-30-7391 PS1372 1 75
807-91-6654 TC3218 1 100
846-92-7186 PC8888 2 50
899-46-2035 MC3021 2 25
899-46-2035 PS2091 2 50
998-72-3567 PS2091 1 50
998-72-3567 PS2106 1 100
NULL NULL NULL NULL //////////////////////////////////////////////////////////////////////////////////////////// I try to do an ADO.NET 2.0-VB 2005 programming in my VB 2005 Express to get @percentage printed out in the VB Form1. I read some articles in the websites and MSDN about this task and I am very confused about "How to Work with Output Parameters & Report their Values in VB Forms": (1) Do I need the Form.vb [Design] and specify its properties of the object and classes I want to printout? (2) After the SqlConnectionString and the connection.Open(), how can I bring the value of @percentage to the Form.vb? (3) The following is my imcomplete, crude draft code:
Dim connectionString As String = "Data Source=.SQLEXPRESS;Initial Catalog=pubs;Integrated Security=SSPI;"
Dim connection As SqlConnection = New
SqlConnection(connectionString)
Try
connection.Open()
Dim command As SqlCommand = New SqlCommand("byroyalty", connection)
command.CommandType = CommandType.StoredProcedure ................................................................... .................................................................. etc. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From the above-mentioned (1), (2) and (3), you can see how much I am lost/confused in attempting to do this task. Please help and give me some guidances and good key instructions for getting the output parameter printed out in the FORM.vb in my VB 2005 Express project.