Click here to Skip to main content
16,014,392 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Why the exception "Object reference not set to an instance of an object." occurs? Pin
Christian Graus30-Jul-07 17:49
protectorChristian Graus30-Jul-07 17:49 
AnswerRe: Why the exception "Object reference not set to an instance of an object." occurs? Pin
daniel__c30-Jul-07 20:34
daniel__c30-Jul-07 20:34 
QuestionWHATS THAT PROBLEMS Pin
Neo_Shehpar30-Jul-07 14:21
Neo_Shehpar30-Jul-07 14:21 
AnswerRe: WHATS THAT PROBLEMS Pin
Christian Graus30-Jul-07 17:48
protectorChristian Graus30-Jul-07 17:48 
GeneralRe: WHATS THAT PROBLEMS [modified] Pin
Neo_Shehpar3-Aug-07 3:17
Neo_Shehpar3-Aug-07 3:17 
QuestionSetting file ContentType dynamically [modified] Pin
ASPnoob30-Jul-07 13:09
ASPnoob30-Jul-07 13:09 
AnswerRe: Setting file ContentType dynamically Pin
Christian Graus30-Jul-07 17:50
protectorChristian Graus30-Jul-07 17:50 
GeneralRe: Setting file ContentType dynamically [modified] Pin
ASPnoob30-Jul-07 19:18
ASPnoob30-Jul-07 19:18 
Hi Christian, the problem is I'm unsure about how to retrieve the info from the database. I have already written code to connect to a database and retrieve data but its for a different purpose. The following is the modified code to try to make the program dynamically set the mime type.
For i = 0 To ListBox1.Items.Count - 1
         If ListBox1.Items(i).Selected Then

             DBCommand = New OdbcCommand("SELECT DocID, Document, DocTypes From ArchiveTB where Authors = '" & ListBox1.Items(i).Text & "'", DBConn)

         End If
     Next
     If Not IsNothing(DBConn) Then
         DBConn.Open()
         DBCommand.Connection = DBConn
         Dim DS As New DataSet
         Dim AD As New OdbcDataAdapter(DBCommand)

         AD.Fill(DS, "ArchiveTB")
         AD.Dispose()
         Me.ListBox2.DataSource = DS
         Me.ListBox2.DataTextField = "DocType"
         Me.ListBox2.DataValueField = "DocID"
         ListBox2.DataBind()

         Dim buffer As Byte() = New Byte(contentLength - 1) {}

         reader.GetBytes(0, 0, buffer, 0, contentLength)

         Response.ContentType = "" & ListBox2.SelectedItem.Text & ""

         Response.BinaryWrite(buffer)

     End If


Please take a look and see if I can do it this way. However, I don't want to force the user to choose the the mime type, how can I do this without using a list box? Thanks again for your help.





-- modified at 3:20 Tuesday 31st July, 2007
GeneralRe: Setting file ContentType dynamically Pin
Christian Graus30-Jul-07 19:27
protectorChristian Graus30-Jul-07 19:27 
Questionupdate panel problem Pin
Mogaambo30-Jul-07 12:07
Mogaambo30-Jul-07 12:07 
QuestionASP.NET Button postback issue [modified] Pin
stoland - work30-Jul-07 9:57
stoland - work30-Jul-07 9:57 
AnswerRe: ASP.NET Button postback issue Pin
Christian Graus30-Jul-07 11:13
protectorChristian Graus30-Jul-07 11:13 
QuestionTable Question Pin
nlindley730-Jul-07 8:54
nlindley730-Jul-07 8:54 
AnswerRe: Table Question Pin
rashadaliarshad30-Jul-07 9:05
rashadaliarshad30-Jul-07 9:05 
GeneralRe: Table Question Pin
nlindley730-Jul-07 9:21
nlindley730-Jul-07 9:21 
GeneralRe: Table Question Pin
rashadaliarshad30-Jul-07 9:30
rashadaliarshad30-Jul-07 9:30 
GeneralRe: Table Question Pin
nlindley730-Jul-07 9:41
nlindley730-Jul-07 9:41 
AnswerRe: Table Question Pin
ToddHileHoffer30-Jul-07 9:06
ToddHileHoffer30-Jul-07 9:06 
GeneralRe: Table Question Pin
nlindley730-Jul-07 9:19
nlindley730-Jul-07 9:19 
QuestionGetting object declared in HTML Component Pin
satindra200230-Jul-07 7:31
satindra200230-Jul-07 7:31 
AnswerRe: Getting object declared in HTML Component Pin
ToddHileHoffer30-Jul-07 9:07
ToddHileHoffer30-Jul-07 9:07 
GeneralRe: Getting object declared in HTML Component Pin
satindra200230-Jul-07 19:00
satindra200230-Jul-07 19:00 
QuestionWeb.Config File Problem...Please Help Pin
rashadaliarshad30-Jul-07 7:27
rashadaliarshad30-Jul-07 7:27 
Questionadding info to another page Pin
brsecu30-Jul-07 5:50
brsecu30-Jul-07 5:50 
AnswerRe: adding info to another page Pin
Pete O'Hanlon30-Jul-07 10:05
mvePete O'Hanlon30-Jul-07 10:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.