New to asp and have no idea what I'm doing wrong here. I just want to open a pdf that I have stored in a table and show it on the page. Here is my code. I keep getting the System.NullReferenceException was unhandled by user code.
Hello,I only have remote access to the db via textual interface.Now I try to find out what an existing stored procedure is doing.I tried like 'desc sp_sale_pro' and 'show sp_sale_pro' - but that is notworking.Can anybody help?Thanks!!Paul
I have a document that is stored in SQL DB - DBname (doctest.mdf)- Table name(Documents)- Column names(ID, LINK, Content, Adddate, FileType). The doc is named Showme.doc What I'm trying to do is I have a listview that is linked to the DB. The columns of the listview show LINK and Adddate. The LINK column is a hyperlink. When the page is loaded the list view shows the info in the DB. The link is a hyperlink so that when I place my cursor over the link it is clickable. Now how do I make it so that when the user clicks on the LINK the document is retrieved and opened? I uploaded the document with the fileupload control. If FileUpload1.HasFile Then Using reader As New BinaryReader(FileUpload1.PostedFile.InputStream) Dim btcontent As Byte() = reader.ReadBytes(FileUpload1.PostedFile.ContentLength) cmd3.Parameters.Add("@CONTENT", SqlDbType.VarBinary).Value = btcontent End Using end if I would be thankful for help. Thanks, Ty
Hi,I need what would be similar to a cross tab query in Access.First Column down needs to show all the months, column headings wouldbe the day of the month....1 2 3 4 etc...JanFebMaretchow do i set this up in a stored procedure?any help to get me in the right direction would be greatlyappreciated!!thanks,paul
I have a stored procedure where I gather some data and then insert the data into a table variable. I then attempt to go through each row of the table variable, asign the values to local variables to be inserted into other tables. However, the local variables show as NULL.BEGIN DECLARE @tblcontact table ( SOKey int, Cntctkey varchar(60), Cntctownerkey int, LASTNAME varchar(32), FIRSTNAME varchar(32), WORKPHONE varchar(32), EMAIL varchar(128), processed int DEFAULT 0 )
Dear people, When i test my page for uploading image too my sql database everthing goes ok (i think) en when i look into my database table i see 3 colums filled 1 column with: Image_title text 1 column with:Image_stream <binary data> 1 column with image_type image/pjpeg How can i show this image in a gridview column..... i have search for this problem but non of them i find i can use because its a too heavy script, or something i dont want. Is there a helping hand Below is the script for uploading the image.....and more
1 2 Imports System.Data 3 Imports System.Data.SqlClient 4 Imports System.IO 5 6 Partial Class Images_toevoegen 7 Inherits System.Web.UI.Page 8 9 10 Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click 11 12 Dim imageSize As Int64 13 Dim imageType As String 14 Dim imageStream As Stream 15 16 ' kijkt wat de groote van de image is 17 imageSize = fileImgUpload.PostedFile.ContentLength 18 19 ' kijk welke type image het is 20 imageType = fileImgUpload.PostedFile.ContentType 21 22 ' Reads the Image stream 23 imageStream = fileImgUpload.PostedFile.InputStream 24 25 Dim imageContent(imageSize) As Byte 26 Dim intStatus As Integer 27 intStatus = imageStream.Read(imageContent, 0, imageSize) 28 29 ' connectie maken met de database 30 Dim myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("Personal").ConnectionString) 31 Dim myCommand As New SqlCommand("insert into tblMateriaal(Image_title,Image_stream,Image_type,ArtikelGroep,ArtikelMaat,Aantal,Vestiging,ArtikelNaam,ContactPersoon,DatumOnline) values(@Image_title,@Image_stream,@Image_type,@ArtikelGroep,@ArtikelMaat,@Aantal,@Vestiging,@ArtikelNaam,@ContactPersoon,@DatumOnline)", myConnection) 32 33 ' Mark the Command as a Text 34 myCommand.CommandType = CommandType.Text 35 36 ' geef alle parameters mee aan het command 37 Dim Image_title As New SqlParameter("@Image_title", SqlDbType.VarChar) 38 Image_title.Value = txtImgTitle.Text 39 myCommand.Parameters.Add(Image_title) 40 41 Dim Image_stream As New SqlParameter("@Image_stream", SqlDbType.Image) 42 Image_stream.Value = imageContent 43 myCommand.Parameters.Add(Image_stream) 44 45 Dim Image_type As New SqlParameter("@Image_type", SqlDbType.VarChar) 46 Image_type.Value = imageType 47 myCommand.Parameters.Add(Image_type) 48 49 Dim ArtikelGroep As New SqlParameter("@ArtikelGroep", System.Data.SqlDbType.NVarChar) 50 ArtikelGroep.Value = ddl1.SelectedValue 51 myCommand.Parameters.Add(ArtikelGroep) 52 53 Dim ArtikelMaat As New SqlParameter("@ArtikelMaat", System.Data.SqlDbType.NVarChar) 54 ArtikelMaat.Value = ddl2.SelectedValue 55 myCommand.Parameters.Add(ArtikelMaat) 56 57 58 Dim Aantal As New SqlParameter("@Aantal", System.Data.SqlDbType.NVarChar) 59 Aantal.Value = ddl3.SelectedValue 60 myCommand.Parameters.Add(Aantal) 61 62 Dim Vestiging As New SqlParameter("@Vestiging", System.Data.SqlDbType.NVarChar) 63 Vestiging.Value = ddl4.SelectedValue 64 myCommand.Parameters.Add(Vestiging) 65 66 Dim ArtikelNaam As New SqlParameter("@ArtikelNaam", System.Data.SqlDbType.NVarChar) 67 ArtikelNaam.Value = tb6.Text 68 myCommand.Parameters.Add(ArtikelNaam) 69 70 Dim ContactPersoon As New SqlParameter("@ContactPersoon", System.Data.SqlDbType.NVarChar) 71 ContactPersoon.Value = tb1.Text 72 myCommand.Parameters.Add(ContactPersoon) 73 74 Dim DatumOnline As New SqlParameter("@DatumOnline", System.Data.SqlDbType.NVarChar) 75 DatumOnline.Value = tb2.Text 76 myCommand.Parameters.Add(DatumOnline) 77 78 Try 79 myConnection.Open() 80 myCommand.ExecuteNonQuery() 81 myConnection.Close() 82 83 Response.Redirect("toevoegen.aspx") 84 Catch SQLexc As SqlException 85 Response.Write("Insert Failure. Error Details : " & SQLexc.ToString()) 86 End Try 87 88 89 End Sub 90 End class
I am looking to created a trigger that inserts records into a log table to show the stored porcedure that has updated a specific column to a specific value in a specific table
At present I have:
CREATE TRIGGER [dbo].[trUpdaterTable] ON [dbo].[t_account]-- A DB level trigger FOR UPDATE --Event we want to capture AS IF update (document_status)
[Code] ...
However this doesn't appear to bring back the procedure that triggered the update...
The value the trigger should update on is document_status = 0
Hello. I was using the new sys.dm_db_index_operational_stats function which is nice for seeing counts of insert/update/delete actions per table index, bla bla bla... Anyways, question, can I do the same thing with Profiler? meaning, can I trace stored procs and sopmehow see the proc exec WITH each table it does actions against? Not talking about filtering on table names in the text, talking I just want to run an application, which uses all stored procs, and see every table used by that execution of the proc, and also the number of rows inserted,updated,deleted.... If so, which Profiler events/columns must I flick on to gather that? Thanks, Bruce
1. I downloaded ChartFXRSTrial and created one chart, and able to deploy it in ReportServer, but the problem is the reports are not showing there, i checked the configuration of .dll files in the help provided by chartFX, but couldn't get anything, so could help me on this.
2. How to give Tooltip for the X- axis or Y- axis values in the ReportServer , i tried using chartproperties of .rdl file, but didnt understand it. can help me on this, and one more i tried with Dundas too, If im giving tooltip as #valy then, it is showing samething in reportserver instead the values of 'Y-axis'.
I'm beginner in asp.net. Can someone show me how to create coding for this page.. i have to create my own login page and database. I'm using sql sever 2005 for database. can someone show me how to make connection with my login button and my database? please....i'm really need help from you all guys.
I need to flag old records and new records with 1 and 0 respectively... can anyone show me how to do it without having to create a temp table? this is what i've got so far...
I have a bar chart and the data are agrupped by Folders (Category groups) and by FileType (Series Groups)... I want to show only the 5 folders with the biggest amount of files... how i could do it?
is have this code, and i know that i have a record with the ID=1 but it will not show the data from the record..<asp:Content ID="Main" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"> <asp:FormView ID="form1" runat="server" DataSourceID="SqlDataSource1"></asp:FormView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStrAccess %>" SelectCommand="SELECT [MainID], [MainText] FROM [SiteText] WHERE ([MainID] = ?)" ProviderName="<%$ ConnectionStrings:ConnStrAccess.ProviderName %>"> <SelectParameters> <asp:SessionParameter DefaultValue="1" Name="SiteMainID" Type="Int32" /> </SelectParameters>
</asp:SqlDataSource> </asp:Content> Why can't it show the record !??
Hello! I'm trying to show one large image and up to five small images. I can not get this to work. The five small images is in a repeater, the big picture is not in the repeater. I Think I just paste the code so you can look at it, i think that is better than me trying to explain moore:) I thougth I could use one of the events of the repeater and bind the large image when the page loads but I dont know what to use SqlDataSourceStatusEventArgs or what? I hope you all aunderstand whatI mean.<table style="background-color: #E4F9DF; margin: 10px 0px 0px 0px; border: 1px solid green;width: 545px; border-collapse: collapse;"><tr><td class="BoldText" colspan="2" style="border-bottom: 1px solid green; background-color: #b0eda2; text-align: center;">Bilder</td></tr><tr><td style="text-align:center"><asp:Image ID="Image1" Width="530px" runat="server" /></td></tr><tr><td> <asp:Repeater ID="Repeater1" OnItemCommand="imgBtnChangePic_Click" DataSourceID="sqlGetAdPics" runat="server"><ItemTemplate> The images will not appear, the shown like the path is wrong.<asp:ImageButton ID="ImageButton1" CommandName="changePic" ImageUrl='graphics/Advertise/<%#Eval("advertisePic")%>' CommandArgument='<%#Eval("advertisePic") %>' runat="server"/></ItemTemplate></asp:Repeater></td> </tr></table> Here is the code behind protected void Page_Load(object sender, EventArgs e){// this works, but I have to get the mage from the database...Image Image1 = (Image)DetailsView1.FindControl("Image1");Image1.ImageUrl = "graphics/Advertise/sadel2.jpg"; }protected void sqlGetAdDetails_Selected(object sender, SqlDataSourceStatusEventArgs e){if (e.Exception != null)lblError.Text = e.Exception.Message.ToString(); }protected void imgBtnChangePic_Click(object sender, RepeaterCommandEventArgs e){// This method is working.if (e.CommandName == "changePic" && Page.IsPostBack){Image Image1 = (Image)DetailsView1.FindControl("Image1");Image1.ImageUrl = "graphics/Advertise/" + e.CommandArgument.ToString();}}
husband built web site, hosted by 1and1, husband can't help right now and 1and 1 won't. I can't get the connection string correct and need some advise. This is the info 1and1 gave me for my db.
Database Name db212583089 User Name xxxxxxxxxxxxxxxx Password xxxxxxxxxxx Host Name mssql02.1and1.com Description jamm Status My bd is uploaded to their server and should connect with the global.asa page, this is what I have as a connection right now and it's not working <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart '==FrontPage Generated - startspan== Dim FrontPage_UrlVars(1) '--Project Data Connection Application("Database1_ConnectionString" = "PROVIDER=SQLOLEDB;DATASOURCE=msssql02.1and1.com;DATABASE=db212583089;UID=dbo212583089;PWD=xDBXzNTt" Application("Database1_ConnectionTimeout") = 15 Application("Database1_CommandTimeout") = 30
this is the error i get on my website when i try to access my db.
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/JAMMDatabase.asp, line 131
This is the code on line 131, some before and some after: strProvider=Application("Database1_ConnectionString")
set objConn = server.createobject("ADODB.Connection") objConn.Open strProvider(line 131)
set cm = Server.CreateObject("ADODB.Command") cm.ActiveConnection = objConn
right now I am totally lost with all this, if someone can help would really appreciate it, thanks, debi
When I create new Database User the login name input does not show on the list and in the "login name " when checking the Properties of the name. Why this behavior? the previous user created a while ago are showing name and login name . permissions and rights are the same for between different users having the two different behaviors.
When I created the new database user I input e.g.: Login Name: AD<<User Name>> Name : "First Name"
I have created a stored procedure in SQL Server which outputs all records in a table. How can I execute that procedure in access please? ( show that table in access?)
Hello. I work on a proprietary software package at work that has a SQL query engine. I'm able to query tables that I know exist but I would like to know what other tables are there in the db. Unfortunately I don't know the name of the database. Is there a SQL statement that will show me the name of the database that I'm running my query on?
Thanks for everyone's help on this mess so far especially Peso. Yes this was originally Oracle SQL and I now need to convert it to SQL.
Can someone start by showing me at least part of this the best way to convert this to regular SQL? Also are there any tips, guides out there that anyone knows of?
selectCSG_Hist.dbo.OJB_JOBS.IR_TECH_OJB as TECHN, substring(CSG_Hist.dbo.OJB_JOBS.COMPL_CDE_OJB, pstn.p, 3) as RESCODE, Parser.dbo.OJB_JOBS.COMPL_DTE_OJB as COMPLET, Parser.dbo.ELP_Codes.CodeDes as [DESCRIPTION], CSG_Hist.dbo.SBB_BASE.RES_NAME_SBB as RES_NAME, CSG_Hist.dbo.HSE_BASE.ADDR1_HSE as [ADDRESS], CSG_Hist.dbo.OJB_JOBS.JOB_TYP_OJB as JOB, CSG_Hist.dbo.OJB_JOBS.JOB_CLASS_OJB as TYP, CSG_Hist.dbo.OCR_ORDER_COMP.ORDER_NO_OCR as NUMB, CSG_Hist.dbo.OCR_ORDER_COMP.LS_CHG_OP_ID_OCR as OPR, Parser.dbo.ELP_Codes.CommissionAMT as NCommissionAMT, COUNT(DISTINCT Parser.dbo.Parser_OCR.ORDER_NO_OCR) as QTYW fromParser_OCR Inner JoinParser.dbo.Parser_OJB on Parser.dbo.Parser_OCR.ORDER_NO_OCR = CSG_Hist.dbo.OJB_JOBS.ORDER_NO_OJB Inner JOINParser.dbo.RGV_Codes on substring (Parser.dbo.Parser_OJB.COMPL_CDE_OJB, pstn.p, 3) = CODE -- IS THIS A VARIABLE/PARAMETER OR A COLUMN NAME? Inner JOINCSG_Hist.dbo.SBB_BASE on CSG_Hist.dbo.OCR_ORDER_COMP.HSE_KEY_OCR = CSG_Hist.dbo.SBB_BASE.HSE_KEY_SBB Inner JOINCSG_Hist.dbo.HSE_BASE on CSG_Hist.dbo.OCR_ORDER_COMP.HSE_KEY_OCR = Parser.dbo.Parser_OCR.HSE_KEY_OCR Inner JOINCSG_NRT.dbo.NRT_OJB_JOBS ON CSG_NRT.dbo.NRT_OJB_JOBS.IR_TECH_NOJB = CSG_Hist.dbo.OJB_JOBS.IR_TECH_OJB cross Join( select 1 as p union all select 4 union all select 7 union all select 10 union all select 13 union all select 16 ) as pstn WHERECSG_Hist.dbo.OJB_JOBS.IR_TECH_OJB between 950 and 999 and Parser.dbo.Parser_OJB.COMPL_DTE_OJB BETWEEN '2007-01-09' AND '2007-01-22' and CSG_Hist.dbo.Parser_OCR.prin_ocr = 8600 GROUP BYCSG_Hist.dbo.OJB_JOBS.IR_TECH_OJB, substring(CSG_Hist.dbo.OJB_JOBS.COMPL_CDE_OJB, pstn.p, 3), Parser.dbo.Parser_OJB.COMPL_DTE_OJB, Parser.dbo.ELP_Codes.CodeDes, CSG_Hist.dbo.SBB_BASE.RES_NAME_SBB, CSG_Hist.dbo.HSE_BASE.ADDR1_HSE, Parser.dbo.Parser_OJB.JOB_TYP_OJB, Parser.dbo.Parser_OJB.JOB_CLASS_OJB, CSG_Hist.dbo.OCR_ORDER_COMP.ORDER_NO_OCR, CSG_Hist.dbo.OCR_ORDER_COMP.LS_CHG_OP_ID_OCR, Parser.dbo.ELP_Codes.CommissionAMT
Hey...I've been cracking head about this one all day, and I'm sure it'san easy answer, but here goes:I have a column entitled Sequ which is defined as a Decimal withPrecision 10 and Scale 5. In an ASP.NET page, I'm performing acalculation which is inserted into the Sequ column. I'm doing aresponse.write, which enables me to see that the numbers are in factbeing calculated correctly complete with a string of numbers after thedecimal, but when I pull the numbers out to use on the page or accessthe table, Sequ lists all numbers as integers. I'm using a storedprocedure in which I'm declaring the @calc parameter (the calculatedvalue which is being inserted) as a Decimal -- I don't know what I'mdoing wrong. Help appreciated...thanks.Erik
I am pretty much brand new to reporting services so I apologize for any simple questions I may ask.
I have created a call report that shows data broken down by day and grouped by week. Everything works great. However, if there is no data on a certain day is does not show me that day on the report. Is there a way I can make it display the day even if there is not data for that day and just give me 0 values? Or do I need to modify my query?
If someone needs a half hour slot for Team1,I need to show all the current appointments for Team 1 that a new half hour appointment can come after but not overlap any other appointment.
So for the example given I would show a list of:
3 4 5
As a half hour appointment could be put in after each of these and not overlap the next appointment.
I have a data base for some equipment on a few windows application forms written in vb 2005 express. eg Form1 for tools , form2 for nuts &bolts ect.
I wondered if it is it possible to set data base to open when the form loads and shows the data of that particular piece of equipment instead of always opening on equipment id number 1 for instance . For example when form3 loads ,equipment id is set to 3.
HiI have this code, but i can't get it to work, and if i delete <% %> then the if statsment is not working, how do i get this code to work. 1 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringMain %>" 2 SelectCommand="SELECT [SiteMainID], [SiteMainText] FROM [MainSiteText] WHERE ([SiteMainID] = @SiteMainID)"> 3 <% Dim pageString As String = "Def" 4 If Not (Request.QueryString("Page") Is Nothing) Then 5 pageString = Request.QueryString("Page").ToString 6 End If 7 If pageString = "Def" Then 8 %> 9 <SelectParameters> 10 <asp:Parameter DefaultValue="1" Name="SiteMainID" Type="Int32" /> 11 </SelectParameters> 12 <% 13 Else 14 If pageString = "Page1" Then 15 %> 16 <SelectParameters> 17 <asp:Parameter DefaultValue="2" Name="SiteMainID" Type="Int32" /> 18 </SelectParameters> 19 <% 20 Else 21 If pageString = "Page2" Then 22 %> 23 <SelectParameters> 24 <asp:Parameter DefaultValue="3" Name="SiteMainID" Type="Int32" /> 25 </SelectParameters> 26 <% 27 28 End If 29 End If 30 %> 31 </asp:SqlDataSource>
Hi, My question is how can i get a page show all of my pictures i got in folder c:..Images? by using Database. Becouse I want some of the pictures to be shown in one page for theirselves. Database looks like: ID | Pname | Pact | 1 | picture1 | Yes | 2 | picture2 | No | etc. Now i want picture 1 and 2 to be shown in my Allpictures.aspx I tried by using <asp:repeater...>... But i got a problem when i wanted the <img src=<%#EVAL(Pname)/>... becouse i cant do it that way... Thanks, Even Knutli