Click here to Skip to main content
15,902,492 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: My database gets cleared upon my application startup Pin
Dave Kreskowiak2-Sep-08 10:22
mveDave Kreskowiak2-Sep-08 10:22 
QuestionRemoting using TCP/IP Pin
anu811-Sep-08 21:39
anu811-Sep-08 21:39 
AnswerRe: Remoting using TCP/IP Pin
Stephen Lintott1-Sep-08 21:50
Stephen Lintott1-Sep-08 21:50 
AnswerRe: Remoting using TCP/IP Pin
Dave Kreskowiak2-Sep-08 10:18
mveDave Kreskowiak2-Sep-08 10:18 
QuestionPlz help Pin
Allrounder1-Sep-08 21:18
Allrounder1-Sep-08 21:18 
AnswerRe: Plz help Pin
Steven J Jowett1-Sep-08 22:47
Steven J Jowett1-Sep-08 22:47 
AnswerRe: Plz help Pin
Paul Conrad2-Sep-08 18:56
professionalPaul Conrad2-Sep-08 18:56 
QuestionSharepoint... Pin
Stephen Lintott1-Sep-08 21:04
Stephen Lintott1-Sep-08 21:04 
Hi all I've got an app that receves a XML file and then load the data in the file into sharepoint the code is as follows.
Dim i As Integer
        Dim str As String = ""
        'For i = 0 To XMLDocument.Length
        '    str = str & XMLDocument.ToString(i)
        'Next
        str = System.Text.UnicodeEncoding.ASCII.GetString(XMLDocument)

        Dim fs As New FileStream("c:\text.xml", FileMode.Create, FileAccess.ReadWrite, FileShare.Delete)
        fs.Write(XMLDocument, 0, XMLDocument.Length)
        fs.Close()
        fs.Dispose()

        Dim xml As New XmlDocument
        '' Dim re As StringReader = New StringReader(str)

        xml.Load("c:\text.xml")


        Dim Site As SPWeb = New SPSite(SitePath).OpenWeb()
        Dim tw As SPListItem

        Dim UpdateList As SPList = Site.Lists(ListBoxToUpdate)

        tw = UpdateList.Items.Add()
        Dim newFolder As SPFolder = Site.GetFolder(ListBoxToUpdate)
        Dim destFolder As SPFolder = Site.GetFolder(ListBoxToUpdate)

        Dim spf As SPFileCollection = destFolder.Files

        For Each node As XmlNode In xml.LastChild


            Dim ArrByte As Byte() = System.Text.Encoding.ASCII.GetBytes(node.Attributes(2).Value)
            
            Dim strImageByte As Byte() = ArrByte
            'spf.Add(node.Attributes(0).Value & "." & node.Attributes(1).Value, strImageByte)

            tw.Attachments.Add(node.Attributes(0).Value & "." & node.Attributes(1).Value, strImageByte)
        Next

        Dim Title As String = ""
        'Title = XmlFiles(x).ToString
        'Title = Title.Substring(Title.LastIndexOf("\") + 1, XmlFiles(x).ToString.Length + 2 - Title.LastIndexOf("\"))

        tw("Title") = "ChargeOutInvoiceNotIndexed"
        tw.Update()
        tw = Nothing
        'spf("Title") '= "ChargeOutInvoiceNotIndexed"


The problem comes in the tw.update call the following exception is being thrown.

"To add an item to a document library, use SPFileCollection.Add()"

Does anybody know of a way around this.

Stephen Lintott Bsc IT (RAU)

AnswerRe: Sharepoint... Pin
Mycroft Holmes2-Sep-08 16:35
professionalMycroft Holmes2-Sep-08 16:35 
QuestionGSM Communication Pin
vahidkiani1-Sep-08 20:14
vahidkiani1-Sep-08 20:14 
QuestionHow to start application from sub main? Pin
Pankaj - Joshi1-Sep-08 18:55
Pankaj - Joshi1-Sep-08 18:55 
AnswerRe: How to start application from sub main? Pin
Thomas Stockwell2-Sep-08 4:49
professionalThomas Stockwell2-Sep-08 4:49 
GeneralRe: How to start application from sub main? Pin
Pankaj - Joshi4-Sep-08 23:15
Pankaj - Joshi4-Sep-08 23:15 
GeneralRe: How to start application from sub main? Pin
Thomas Stockwell5-Sep-08 1:21
professionalThomas Stockwell5-Sep-08 1:21 
QuestionHiding Secret Key & Initialization Vector from Decompiler Pin
Amit Kushwaha1-Sep-08 18:11
Amit Kushwaha1-Sep-08 18:11 
AnswerRe: Hiding Secret Key & Initialization Vector from Decompiler Pin
Dave Kreskowiak2-Sep-08 10:16
mveDave Kreskowiak2-Sep-08 10:16 
QuestionVisual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
DCAUB1-Sep-08 15:32
DCAUB1-Sep-08 15:32 
AnswerRe: Visual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
Mycroft Holmes1-Sep-08 17:48
professionalMycroft Holmes1-Sep-08 17:48 
GeneralRe: Visual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
DCAUB1-Sep-08 20:44
DCAUB1-Sep-08 20:44 
GeneralRe: Visual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
Dave Kreskowiak2-Sep-08 10:14
mveDave Kreskowiak2-Sep-08 10:14 
GeneralRe: Visual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
DCAUB3-Sep-08 20:20
DCAUB3-Sep-08 20:20 
GeneralRe: Visual Basic .net 2008 Application Full Screen ? How so that the user can acces anything else Pin
Dave Kreskowiak4-Sep-08 1:58
mveDave Kreskowiak4-Sep-08 1:58 
QuestionThreading Pin
~V~1-Sep-08 1:40
~V~1-Sep-08 1:40 
AnswerRe: Threading Pin
Tony Richards1-Sep-08 5:38
Tony Richards1-Sep-08 5:38 
AnswerRe: Threading Pin
Paul Conrad1-Sep-08 12:50
professionalPaul Conrad1-Sep-08 12:50 

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.