I have a procedure that allows a user to enter two dates to run a query. I would like to display those dates on the generated report underneath the title. "5-01-07 to 5-31-07" How would I do this?
I'm having a problem with some data in our database, basically a web app is storing data into the DB and then recalling it to display to a user. The problem I am having is that for one particular function the DB is causing the app to fail, the app code works for 95% of the data inserted into the DB by the users but it is failing on a few records.. I'v gone through the data manually checking for funny characters or spaces or anything else which is different from the other records, but everything seems to be in order. I doubt very much that this is a system app code problem as the code is working perfectly for all the other records...
Can anyone advise me on what else I can check.. really stuck on this one guys
Im trying to add a new rcord to my db on a button click usign the following code
'data adapter Dim dAdapt1 As New SqlClient.SqlDataAdapter 'create a command object Dim objCommand As New SqlClient.SqlCommand 'command builder Dim builderT As SqlClient.SqlCommandBuilder 'connection string Dim cnStr As String = "Data Source=ELEARN-FRM-BETA;Initial Catalog=StudentPlayGround;Integrated Security=True" 'dataset Dim dsT As DataSet Private Sub connect() 'connection objCommand.Connection = New SqlClient.SqlConnection(cnStr) 'associating the builder with the data adapter builderT = New SqlClient.SqlCommandBuilder(dAdapt1) 'opening the connection objCommand.Connection.Open() 'query string Dim query As String = "SELECT * from StudentPlayground..Employees" 'setting the select command dAdapt1.SelectCommand = New SqlClient.SqlCommand(query, objCommand.Connection) 'dataset dsT = New DataSet("Trainee Listings") dAdapt1.Fill(dsT, "Employees") End Sub Private Sub BindData() connect() DataBind() End Sub Protected Sub submitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submitButton.Click Dim empID As Integer = CType(FindControl("TextBox8"), TextBox).Text BindData() Dim firstName As String = CType(FindControl("TextBox1"), TextBox).Text BindData() Dim lastName As String = CType(FindControl("TextBox2"), TextBox).Text BindData() Dim location As String = CType(FindControl("TextBox3"), TextBox).Text BindData() Dim termDate As Date = CType(FindControl("TextBox4"), TextBox).Text BindData() Dim hireDate As Date = CType(FindControl("TextBox7"), TextBox).Text BindData() Dim dept As String = CType(FindControl("TextBox5"), TextBox).Text BindData() Dim super As String = CType(FindControl("TextBox6"), TextBox).Text BindData() Dim newRow As DataRow = dsT.Tables("Employees").NewRow newRow.BeginEdit() newRow.Item(0) = empID newRow.Item(1) = firstName newRow.Item(2) = lastName newRow.Item(3) = location newRow.Item(4) = hireDate newRow.Item(5) = termDate newRow.Item(6) = dept newRow.Item(7) = super newRow.EndEdit()
'do the update Dim insertStr As String = "INSERT INTO Employees" + _ "(EmployeeID,FirstName,LatName,Location,HireDate,TerminationDate,Supervisor)" + _ "VALUES (empID,firstName,lastName,location,hireDate,termDate,dept,super)" Dim insertCmd As SqlClient.SqlCommand = New SqlClient.SqlCommand(insertStr, objCommand.Connection) dAdapt1.InsertCommand() = insertCmd
dAdapt1.Update(dsT, "Employees") 'Dim insertCmd As new SqlClient.SqlCommand = (builderT.GetInsertCommand()).ToString()) 'dAdapt1.InsertCommand = New SqlClient.SqlCommand(insertCmd.ToString(), objCommand.Connection) BindData() objCommand.Connection.Close() objCommand.Connection.Dispose() End Sub
im not sure wats going wrong because the record is not being added. Please help!!
hi Actually in my project we need to validate the mailid entered by the user not simple validation ,i need to validate wheather the mailid exists .Ex: ravishankar@yahoo.com entered by user whether this mailid is existed in the yahoo or not i,e we want wheather it exists or not................ Please if any one know the solution please send to me .............
I need to have a script where it ask the user for a value, the script will search for all records that match the value. Then it will display the numbers of records found and ask the user to enter a different value. The rest of the script will use this new value and increment by 1 n times as the number of records found. I started the script where it will ask for "HANDLE" and display the number of records found with that "HANDLE"
declare @HANDLE as varchar(30) declare @COUNT as varchar(10) declare @STARTINV as varchar(20)
set @HANDLE = ?C --This is the parameter to search for records with this value set @STARTINV = ?C --User will input the starting invoice number SELECT COUNT as OrderCount FROM SHIPHIST where HANDLE = @HANDLE
I just can't figure out how to proceed to use the entered invoice # and increment by 1 until it reach the number of records found.
This will be the end results:
Count=5 --results from query STARTINV=00010 --Value entered by user
Hai ,I created a table with primary key clustered. I have entered the datathru E.Manager . If a close the table and open it again , Ii shows therows with the (default) ascending order. Is, there any way to get therows in the user entered order(neither asc or dec order)With ThanksRaghu
I have a table where the designer allowed time reporting for 8 different types of activity on each timecard, then stored the hours by activity in 8 separate columns in the database. Example:
Table A. Column Headers: Employee|Date|Phase1Hours|Phase2Hours, etc... Data: Fred Jones| 7/15/13 |3|3, etc...
The problem is there is no way based on this structure to get an employee's hours for the day in columnar form.
To get this data into columnar form I have used Select queries with Union All, for instance:
SELECT Employee, Date, Phase1 FROM Table A UNION ALL SELECT Employee, Date, Phase2 FROM Table A ,etc.....
Query is running slow (I am guessing it is because the same table is repeatedly being accessed).
I need to be able to prevent an invalid character from being entered into a sql 2000 databae on import from oracle.
In short, I need to exclude a certain character from being entered and need to be able to send an email which specifies that an attempt was made to enter this character, if the change was due to an insert or an update, the row to be affected in the target database, date and time info. Also the source of the data.
If this is not possible, is it viable to remove the character after insert and still send the email withe the required info?
Any one any ideas on the cleanest way to achieve this?
'The value you entered is not consistent with the data type or length of the column'
when trying to enter data into a feild, the feild type is char and the length is 100 i'm entering text 3 words long but no where near a 100 characters long any one know why this is happening?
Hi,I want to know the optimal solution, to find if all the data was entered. Lets say, Table A (date field) and for a given month, i need that all the days in the given month are present in the Table A. Right now i have different solutions, 1) a stored procedure which loops through all the days in the given month against a select statement on Table A2) a stored procedure, create a temp table which contains all the dates in the given month, and a single select statement using where condition (select * from.... where datefield not in (select * from...))I want to know what is the best solution of these two or any other solution.Thanks
I have 2 SQL server 2000 machines, I need to take a table from each one and combine them together based on a date time stamp. The first machine has a database that records information based on an event it is given a timestamp the value of variable is stored and a few other fields are stored in Table A. The second machine Table B has test data entered in a lab scenario. This is a manufacturing facility so the Table A data is recorded by means of a third party software. Whenever a sample is taken in the plant the event for Table A is triggered and recorded in the table. The test data may be entered on that sample in Table B several hours later the lab technician records the time that the sample was taken in Table B but it is not exact to match with the timestamp in Table A. I need to combine each of these tables into a new SQL server 2005 database on a new machine. After combining the tables which I am assuming I can based on a query that looks at the timestamp on both Tables A & B and match the rows up based on the closest timestamp. I need to continuously update these tables with the new data as it comes in. I havent worked with SQL for a couple of years and have looked at several ways to complete this task but havent had much luck. I have researched linked servers, SSIS, etc Any help would be greatly appreciated.
Hi;My company just installed MS SQLServer 2005 ( see below the dottedline ).When a user logs into management studio all of the databases on theserver are displayed in the right hand column.What can we do to have only the databases the user has rights to,display?Thanks much in advance for any info.Steve-------------------------------------------------------------------Microsoft SQL Server Management Studio9.00.1399.00Microsoft Analysis Services Client Tools 2005.090.1399.00Microsoft Data Access Components (MDAC) 2000.085.1117.00(xpsp_sp2_rtm.040803-2158)Microsoft MSXML2.6 3.0 4.0 6.0Microsoft Internet Explorer7.0.5730.11Microsoft .NET Framework 2.0.50727.42Operating System5.1.2600
Is it possible to display multivalue user input parameters within the report, so the user can see what he just entered in the parameters? I only can get the first or the second value within a textbox: (parameters!year.value(0) / parameters!year.value(1))
The desired output i want to achive is that the multiple selections are displayed within one text box:
I would like to create a database for keeping track of payroll data for employees where the supervisors (job coaches) on our workshop floor can use a Pocket PC device to record the hourly employee data on the fly. Then at the end of the day, the supervisor can place the device in a cradle of some sort and synch the newly entered data into the main database.
I'm guessing that SQL Server Compact edition would be perfect for this type of task? Is that correct? Can someone give me recommendations on how to go about setting this up? What should I use as the main database? SQL Server? Access? Any advice is appreciated!
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee
Hello I have a project that uses a large number of MS Data access pages created in Access 2003 and runs on MS SQL2005.
When I am on lets say my client, (first page in a series) data access page and I have completed the fields in the (DAP), I am directing my users to the next step of the registration process by means of a hyperlink to another Data access page in the same web but in a linked or sometimes different table.
I need to pass data entered /created on the first page to the next page and populate the next page with some data from the first page / table. (like staying on the client name and ID when i go to the next page)
I also need the first data access page to open and display a blank or new record. Not an existing record. I will also be looking to creata a drop down box as a record selector.
Any pointers in the right direction would be appreciated. I am some what new to data access pages so a walk through would be nice but anything you got is welcome. Thanks Peter€¦
Dont laugh; How do I create a simple sqlcommand in C# that shows data. I have the code for VB but I a missing something in the converstion. I know SQL but I dont get the simple steps of displaying data. I have got all of the Visual Basic stuff down I just need help with doing it by hand in C#. or point my to a URL so that I can get the code. Thanks
Hi all, this is a very basic question of diplaying a data. on my aspx page I have datasource that will return only ONE record. <asp:SqlDataSource ID="sdsCategoryName" runat="server" ConnectionString="<%$ ConnectionStrings:KaruselaConnectionString %>" SelectCommand="SELECT Title FROM tbh_Categories WHERE CategoryID=@categoryID "> <SelectParameters> <asp:QueryStringParameter DefaultValue="-1" Name="CategoryID" QueryStringField="id" Type="int32"/> </SelectParameters> </asp:SqlDataSource> on the server side I would like to manipulate the title of the page according to the data returned from the query: and on the behind code if (!this.IsPostBack && !string.IsNullOrEmpty(this.Request.QueryString["ID"])) { DataView dv2 = (DataView)sdsCategoryName.Select(arg); this.Title = string.Format(this.Title, dv2.Table.Columns[0].ToString()); dv2.Dispose(); } of course it doesn't work. my question is this. do we really have to put the query datasource on the client side?and secondly, how can I view the recorsd I recieves from the query?Thanks for the help.
Hi I have used the create user wizard to create a registration page my table stores the user details and user id. I am also using the login wizard to create a log in page . I now want to display the details of the currently logged in user usind details view and allow them to view and edit their details. where and how do i create the session varible anh how do I wtire the sql select statement say select first name from table1 where (the userid I stored earlier in a table when the user registered ) = (this should be the currently logged in user'id). I am a novice so I would appreciate code snippets My code in asp page for the details looks like this asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource1" Height="50px" Width="125px"> <EditRowStyle BackColor="#CCFF99" /> <AlternatingRowStyle BackColor="#FFCCFF" /> </asp:DetailsView><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" SelectCommand="SELECT [FirstName], [LastName], [City], [Listing] FROM [UserDetails] WHERE ([UserId] = @UserId)"> </asp:SqlDataSource>
novice This shows no data when I test it. I have tried the folling in the .vb page no luck. Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBound Dim UserId As Integer = Me.DetailsView1.DataItem("userID")Session("_UserID") = UserId End Sub
Hi. Not sure which section this request needs to be put in, but i'm relatively new to SQL.
I have 1 table which contains an user_id (autonumber), user_name, and user_profile.
I have 2 other tables: config_version (cv) and config (c)
These two tables both access the user table (us) to view the user_id (which is required).
I want to be able to view the user_names for both "cv" and "c" on a seperate page. Using the code below, i'm lost. I created what i wanted in MS Access with the use of a 2nd table (this might be easier to understand than my rant above). However, I don't want a 2nd table.
Can someone provide me with a function, or the "answer" to my problem?
Highlighted Blue - just there to fill in the front page with data (not wanted) Highlighted Green - doesn't work, but was my first attempt
Code: public function ShowQuotes Dim objConn Dim objADORS Dim strSQL Dim row
Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = strConn objConn.Open
Set objADORS = CreateObject("ADODB.RecordSet") strSQL = "Select top 50 " strSQL = strSQL & " cv.config_version_id as cvid, cv.configuration_id as cid, cv.version_number as cnum" strSQL = strSQL & ", cv.status as cstat, cv.total_price as cprice, cv.modification_date as cmod, cv.version_description as cvrem" strSQL = strSQL & ", c.remarks as qrem" strSQL = strSQL & ", p.prod_description as pdesc, p.version as pvers, p.status as pstat" strSQL = strSQL & ", cust.customer_name as custname" strSQL = strSQL & ", us.user_nt_login as modname" strSQL = strSQL & ", us.user_name as usname" ' strSQL = strSQL & ", cv.user_id as modname" strSQL = strSQL & " from tbl_config_version as cv, tbl_configuration as c, tbl_product as p, tbl_user as us, tbl_customer as cust" strSQL = strSQL & strWhere 'SETS RESULTS TO BE UNIQUE strSQL = strSQL & " and us.user_id = c.user_id" strSQL = strSQL & " and cv.configuration_id = c.configuration_id" strSQL = strSQL & " and c.product_id = p.product_id" strSQL = strSQL & " and c.customer_id = cust.customer_id" strSQL = strSQL & strOrderBy & ";"
In sql server, multiple instances of data default to a row display or vertical. I need a set of data in sql2005 to view horizontally so I can us it in a crystal report. Here is my issue. gift.HonorKey, gift.HonorName, gift.HonorId 1211 Smith 1222 1244 Owens 4155
I need for the data to read like this: HonorKey1, HonorKey2, HonorName1, HonorName2, HonorId1, Honorid2 1211 1244 Smith Owens 1222 4155
the table name is gift_view
I would like to be able to create a view in sql analyzer, then save as an SQL View My direct email is jackfam@comcast.net
Im trying to display data from a database based on an input value. The value in the Label12.Text which is("hotmail") is the input value thats stored in the database, this value is been searched for in the strSQL. Dim strSQL As String = "SELECT Name FROM Jobseeker WHERE Email='" & Label12.Text & "' " strSQL = Label5.Text
the code builds successfully, but Label5.Text appears blank.
Hello, Im new to SQL. Im currently having a table called Daily with 5 columns. TesterNames,Activity,Hours_given,Hours_used and Delta. I have grabbed the data for the first three colums from another table called Tester. For Hours_used I supposed to get the data from another server after i get the access but mean time i just put my own data so that i can check the value of Delta. Data for Delta column should be as below. Delta = Hours_given - Hours_used So How do I do the codings for this expression and display it in the same table. Output I need as below: TesterNames Activity Hours_given Hours_used Delta abc A 5 6 -1 def B 7 6 1
I have used INSERT INTO Daily ( TesterNames,Activity,Hours_given) SELECT ( Tester_ID,Weekday_Day,EntityWDD) FROM Tester and the first 3 columns are filled with the data needed. But when I use INSERT INTO DAILY(Delta) SELECT Delta = Hours_given - Hours_used FROM DAILY The output was like below TesterNames Activity Hours_given Hours_used Delta abc A 5 6 def B 7 6 Null Null Null Null -1 Null Null Null Null 1 Help me . thank you.
Everything works great on my development box. I am using GoDaddy for production (ASP.Net v2, SQL 2000). I am not receiving any errors, so I am stumped; no data from the database is displaying on the GoDaddy pages. I updated the connection string in web.config to this:
But I am unsure if this is the issue?? Any insights? This is the page I am working on: www.sugarandspicebakery.com/demo/bakery/default.aspx. So, the page displays fine, but it should be showing data from the database. This particular page uses a DataList with ItemTemplate. There is definitely data in the database, and I have even ran the same exact query from the code using the Query Analayzer on GoDaddt and it returned results I know there isn't much info to go by, but I am hoping someone has some insight since I have been trying to figure this out for days now! Thank youJennifer
I defined a stored procedure with a cursor inside for updating data. When I call it from an MSAccess client, it fails. When I execute it directly in a ISQL/w windows, it doesn`t fail but it displays me the data (wich is the reason for failing from MSAccess). Do somebody know if I could do it without displaying data in the screen ??
Hey all, hopefully this question is in the right spot. I'm writing a .NET app talking to a MS SQL 2000 DB. I have two date range input boxes, and I want to display the data (probably in a dataGrid) from those 2 certain dates. How do I go about this with my SQL server??
My DB table has a date field that I would use to search for the data between those two user specified dates. Any tips, examples, etc. would be greatly appreciated!!!
I have a table where I need to display groupings of information. If there isn't any data for a given group, I still need to include that group and say "no applicable data" or somesuch underneath it. Any way of doing this?