|
You need to work out GetManifestResourceStream. It actually scopes your folder structure I believe, so if it's in a folder called Bitmaps, it's going to be Bitmaps.statuses.bmp, and perhaps even has your root namespace at it's head.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
i am using data grid and i want to update it when user change i but the fallowing command in button to save update but it did not work and it give error massage
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(DataAdapter1)
Dim CmdB As New OleDb.OleDbCommandBuilder(DataAdapter1)<br />
DataAdapter1.Update(DataSet1, "Section")<br />
<br />
the error messge (Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.)
|
|
|
|
|
Hello,
This error comes up when the Select statement does not return any Primary key column.
The SelectCommand must return at least one primary key or unique column. If none are present, an
InvalidOperation exception is generated, and the commands are not generated.
For more details on this, you may refer to the given MSDN Link:
http://msdn.microsoft.com/en-us/library/tf579hcz.aspx[^]
I hope this helps.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
thanks i put the primery key but it give me error in update statment
please help if you can
|
|
|
|
|
This doesn't seem like it should be hard but all I get is a blank form. Is there an error in my syntax? I checked, the file does exist at that location and it does contain text.
Imports System
Imports System.IO
Imports System.Text
Public Class Form3
Public Class Test
Public Shared Sub Main()
Dim path As String = "c:\temp\mytest.txt"
If File.Exists(path) = False Then
' Create a file to write to.
Dim sw As StreamWriter = File.CreateText(path)
sw.WriteLine("Hello")
sw.WriteLine("And")
sw.WriteLine("Welcome")
sw.Flush()
sw.Close()
End If
' Open the file to read from.
Dim sr As StreamReader = File.OpenText(path)
Do While sr.Peek() >= 0
Console.WriteLine(sr.ReadLine())
Loop
sr.Close()
End Sub
End Class
End Class
-Live long and prosper
|
|
|
|
|
Hello,
I have checked the working of the code and everything seems to be working.
I get a file created with text in it and also get the strings written in OutPut Window.
However, I am not sure what exactly you are looking for. If I am assuming correctly, are you
looking to write the text on the form or what. Can you explain the things in detail?
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Add a label to your form. Then do this
label.Text = File.ReadAllText(path)
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I can see nothing wrong with your code but then again I am a C# developer not a VBer (anymore). However the one thing I will point out is to dispose of your streams. In C# there's a nice using statement but in VB I presume you'll have to do something like the following:
Dim sr As StreamReader = File.OpenText(path)
Do While sr.Peek() <> -1
Console.WriteLine(sr.ReadLine())
Loop
sr.Close()
sr.Dispose()
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
hi
is their is away to check the first three letter from string
|
|
|
|
|
Hello,
You can use the Substring() method to implement the same.
For example:
<br />
<br />
Dim str As String = "Test String"<br />
MsgBox("First Three letters: " & str.Substring(0, 3))<br />
<br />
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
|
Hello, I have 2 Excelbooks, ver8 and ver9. And I must have a value whith me in to ver8 created in ver9. But I failed in all my tryings...
I start the Excelbook ver9 and whithin the macro in ver9 I started Excelbook ver8. I want to passed an If-statement whith help of this public variable (NyVerNr) from ver9 but I cant transfer the value in the public variable "NyVerNr" - howe do I do this ?
I try this code:
Public OldVerNr As Integer
Public NyVerNr As Integer
---------------------------------------------------------------
Private Sub FetchFlexTime_Click()
Dim OldVer As String
Dim NyVerNrText As String
Dim NyYearNr
Application.ScreenUpdating = False
OldVer = "F:\Documents\Flextid8.xls"
NyVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
NyVerNr = Right(NyVerNrText, 2)
' this is all right - now I have a value in NyVerNr !
Workbooks.Open Filename:=OldVer
"and now is ver8 open - and here is the macro in ver8"
Private Sub Workbook_Open()
Dim NyVerNr As Integer
Dim OldVerNr As Integer
Dim VerNr As Integer
'fetch the earlier NyVerNr and calculate the difference. The OldVerNr is 8 the NyVerNr should be 9
OldVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
OldVerNr = Right(OldVerNrText, 2)
VerNr = NyVerNr - OldVerNr
' but when I come to this part I have lost the value in NyVerNr, fetch from ver9
' the result for VerNr should be 1 - whitch means that I will passed this If-statement !
If VerNr <= 0 Then
please help me to get right !
/keda
modified on Tuesday, May 13, 2008 11:17 AM
|
|
|
|
|
Hai all,
i am totally new for xml files in .net.
i have one xml file like
<Gateway>
<Name>ONE</Name>
<UserID>inone</UserID>
<PWD>one</PWD>
<URL>http://ap.abc.com/http/sen.asp?user={0}&password={1}&track=1</URL>
<Weight>100</Weight>
</Gateway>
<Gateway>
<Name>Two</Name>
<UserID>intwo</UserID>
<PWD>two</PWD>
<URL>http://ap.abc.com/http/sen.asp?user={0}&amp;password={1}&amp;track=1</URL>
<Weight>90</Weight>
</Gateway>
now i had to get the url by using the category(Name ONE,TWO)in xml file.....
in a function
public function geturl(by val category as string)string
dim strurl as string=""
*********** I need some guidance to...how to get the url which is in xml in vb.net?
return strurl
End function
Thanks
Subbu.
|
|
|
|
|
Load the XML into the XmlDocument class. This impliments the standard W3C DOM for accessing XML. Then you can do something like
doc.SelectNodes("/Gateway/URL")
to get a collection of the URL nodes, which you can then iterate over and examine. The language used to selecte nodes is called XPath.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Communication between multiple instances of a program with Shared members and events.
This works fine as long the instances are started by the same thread.
If I start multiple instances by clicking the exe file it doesn’t work.
What to do?
|
|
|
|
|
You need to create cross process communication, probably using WCF.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks mr Graus,
I have to stay with .NET 2.0 and for WCF it seems that 3.0 is needed
What other options are there?
Regards from Sweden
|
|
|
|
|
Hi all,
i want to convert RTF to PDF programmatically.
i had tried itextsharp also , but i am not able to figure out what to do
is there any one experience in this area
thanks in advance
|
|
|
|
|
If you're planning on writing your own component then you'd probably need to look at the RTF Specification, figure out how to read it and then map these different things onto the iTextSharp interface. It's a fairly obtuse interface I know (I've worked with it) but the biggest issue I see here is parsing the RTF.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Hi,
Please I need to put the row number at RowHead of each row i am using VB.Net 2003
Mohammad Al Hoss
|
|
|
|
|
hi,
i m assuming you are asking about datagridview. In vb.net 2005 following statement works
Dim Str As String = "YourValue"<br />
DataGridView1.Rows(DataGridView1.Rows.Count - 2).HeaderCell.Value = Str
hope this also works in vb.net 2003
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Sory this does not work in vb.net 2003 but thanks alot for the help
Mohammad Al Hoss
|
|
|
|
|
hi all
I have one problem.I have one table in access which contains one field named as Visible,datafield as "yes/No".In evry table i have this field.
One starnge thing is : I connect my database to report,All reports which are having "VISIBLE" field.When i run my crystal report,i got answer of that field as "Y" or "N" in some of the reports.And answer of another reports as "TRUE" or "Flase"
How could be possible?
Thanks
monika
|
|
|
|
|
monika_vasvani wrote: Subject:VB.NET
How is that helpful ?
monika_vasvani wrote: How could be possible?
I guess sometimes it's being shown as a different datatype, one to which is can be converted ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's probably the formatting property in your crystal report. Since the variable is Boolean, the formatting in the report will determine "Yes" or "Y".
|
|
|
|