|
i want to design a feedback form n which i have kept a multiline textbox for putting comments of the user and then hit the submit button to submit the comment into the database. but when i want to retrive those comments from the database & view them in a grid,i just got the continious lines of data...my requirement is i want to view the data in that manner and style in which i have enterd it during the submission process with the same style and manner...can anybody help me in this regard how to do it or can give me any link regarding this..(like paragraph,heading...etc..)
thanks in advance..
pradip kishore
|
|
|
|
|
I have an form having following fields are populated by sql server 2000
Name, age, dob,phonenumber,date,accountnumber
and this data is stored into sql server
now I want this data will be output to an ASCII text file.
How can i do this and for the same plz provied me the code.
|
|
|
|
|
This is two problems, both widely documented on the web. One is to get the data out of SQL Server. Then next is to iterate over this data and write it to a file. If you haev VB2005, you have the my.filesystem shortcut, which just hooks into the System.IO namespace to create files.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have written a web service that builds an XML document and returns it as a string.
But at the moment it builds the XML to a file (using System.Xml.XmlTextWriter) then
opens the file (using XmlDocument.load(c:\... etc)).
Is there a way to write XML directly to a string? As writing to a file can cause problems
with file access and so on if there is any errors.
|
|
|
|
|
Hi,
Just started to learn about reading files, text, binary, whatever. I thought, hey, I can make a Hex editor like this, beginning with a Hex reader offcourse. Got to start somewhere and I just want to learn.;P
Here's my code so far
Dim bytArray As Byte()<br />
Dim intFileLenght As Integer<br />
Dim bldHexData As New StringBuilder<br />
Dim bldCharData As New StringBuilder<br />
Dim i As Integer<br />
<br />
If dlgOpen.ShowDialog = DialogResult.OK Then<br />
strFileName = dlgOpen.FileName<br />
<br />
End If<br />
<br />
Me.Text = strFileName<br />
<br />
Dim strmFile As New FileStream(strFileName, FileMode.Open, FileAccess.Read, FileShare.Read)<br />
Dim rdrFile As New BinaryReader(strmFile)<br />
<br />
intFileLenght = strmFile.Length<br />
<br />
bytArray = rdrFile.ReadBytes(intFileLenght)<br />
<br />
For i = 0 To bytArray.Length - 1<br />
Select Case True<br />
Case bytArray(i) = 0<br />
bldHexData.Append("0" & bytArray(i).ToString("X") & " ")<br />
bldCharData.Append(".")<br />
Case bytArray(i) < 16<br />
bldHexData.Append("0" & bytArray(i).ToString("X") & " ")<br />
bldCharData.Append(Chr(bytArray(i)))<br />
<br />
Case bytArray(i) >= 16<br />
bldHexData.Append(Hex(bytArray(i)).ToString & " ")<br />
bldCharData.Append(Chr(bytArray(i)))<br />
<br />
End Select<br />
<br />
Next<br />
<br />
txtHex.Text = bldHexData.ToString<br />
txtChar.Text = bldCharData.ToString
This works on small files, but crashes on anything big (say, a divx movie of 700 MB), gives an OutOfMemoryException. Anyone know VirtualDub? It has a Hex editor, it opens a file instantly.
What magic is this? How do they do that? Is it at all possible in VB.Net?
If you want to know The Truth, STOP lying.
|
|
|
|
|
SilentBob101 wrote: What magic is this?
It isn't magic. There is no such thing.
SilentBob101 wrote: How do they do that?
It is an illusion. Like Penn and Teller.
SilentBob101 wrote: Is it at all possible in VB.Net?
Yes.
The secret to the illusion is that they only open a small part of the file at a time. They do not try to read the whole thing in to memory in one go. They also dump parts of the file that they no longer need from memory to free up space for the bit you are currently viewing.
|
|
|
|
|
Colin Angus Mackay wrote: they only open a small part of the file at a time
Is that like this? Setting the buffersize at the end?
Dim strmFile As New FileStream(strFileName, FileMode.Open, FileAccess.Read, FileShare.Read, 2048)
Colin Angus Mackay wrote: They also dump parts of the file that they no longer need from memory to free up space for the bit you are currently viewing.
Any chance you know how that's done? Or where can I find more info on the subject? It has to be VB.Net, I'm not yet ready for C#
If you want to know The Truth, STOP lying.
|
|
|
|
|
SilentBob101 wrote: Any chance you know how that's done?
No, but I can work it out.
The high lever overview is:
I'd create a virtual file object that tracks where I actually am in the file. It would maintatin an internal buffer that contains the details of the area of the file you are currently interested in.
On the presentation layer part, I'd create a control that only contained the representation of what is currently on the screen. If the user scrolls the control it goes back to the virtual file to read the next bit (or previous bit).
If the user changes anything the virtual control would also maintain a change history that it would give out in place of parts of the real file. When the file was closed the change history would be used to write the changes to the disk quickly an efficiently.
|
|
|
|
|
|
SilentBob101 wrote: Virtual file object?
Something you create. It isn't in the system.
SilentBob101 wrote: Create a control? Not use a standard one?
Yes. While the display capability may be in an existing control all ready is is better to create your own control that includes the behaviour that you want rather than having the behaviour in the form. It also means that you can move the control to other forms (or even projects) in the future without having to disentagle the code from a form.
SilentBob101 wrote: If you know any site where I can find some info
This one?
As I said before, I gave a high level overview (what marketing managers like to call the "helecopter view" and CEOs "The Big Picture") The detail is up to you. It really depends on what functionality you want.
|
|
|
|
|
To speed things up, I would probbably keep 3 read buffers going. One for what's on screen, one for the previous page, and one for the next page. So that while you're reading the screen, the computer is loading the next. Just to try to stay ahead of the reader.
Hope this helps
Rob
Hope this helps
Rob
|
|
|
|
|
Thats where the virtual file object comes in. It can hold on to the bit before, the bit after and the bit needed now without anything external being having to deal with it.
|
|
|
|
|
can we pass a value from one windows form to another windows form as we do in asp.net (using session or cookies)..???i m using vb.net...
for ex i have a main form (form_main) in which i enter a id no in a textbox (tbid).when i press the submit button,another form(form_month) will be displayed which will ask for the monthly break up of the amount collected in the form_main. i want to enter the monthly break up amount along with the id (which is present in the form_main in tbid textbox).how can i insert that selected id value (from the form_main ) into the form_month when i will press the submit button of form_month (since form_month doesnt contain the field tbid..so i cant write the tbid.text value in the nsert query if form_month)
i want to save the data of form_main and form_month in 2 different tables with a common attribute id in both table
its urgent...any help in this regard will be highly appreciated..
pradip kishore
|
|
|
|
|
form_month needs to know about form_main
In form_month:-
<br />
Public Class form_month<br />
<br />
Private m_FormMain As form_main<br />
<br />
<br />
Public Sub New(ByRef formMain As form_main)<br />
MyBase.New()<br />
m_FormMain = formMain 'setting a ref to the orig form form_main<br />
<br />
' This call is required by the Windows Form Designer.<br />
InitializeComponent()<br />
<br />
' Add any initialization after the InitializeComponent() call.<br />
<br />
End Sub
In form_main:-
Public Class form_main<br />
Dim m_form_month As New form_month(Me)
in the code for the submit button to open form_month:-
m_form_month.Show()
in the code for the load event for form_month read the value of tbid:-
Private Sub form_month_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
<br />
Dim contentsOftbid As String<br />
contentsOftbid = m_FormMain.tbid.Text
hope this helps
Alex
|
|
|
|
|
That would work, but the problem is you need to make your controls public. Instead, you should expose properties, or use delegates, to hide as much detail of your class as possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Alex
thanks a lot for your simple and quick response..
pradip kishore
|
|
|
|
|
|
please help me on.... How can i upload an entire folder?
Feroze
|
|
|
|
|
Not possible in pure HTML. You will have to use som kind of java-applet.
Take a look at http://www.javaatwork.com or search google for "java applet upload"
---------------
http://serverside.no
|
|
|
|
|
sir/madam,
I invoked a control named datagridview in the design form.
Than in the code behind file , i was trying to write
Dim m as new datagridviewmemocolumn
but datagridviewmemocolumn was not there in the list of functions.
Please help.
Thanks and regards
Pankaj
-- modified at 2:36 Monday 15th January, 2007
|
|
|
|
|
hi pankaj,
will tell in detail....why u required datagriviewmemocolumn?
priya
|
|
|
|
|
Good AfterNoon Madam,
My previous problem is solved .I need ur help in an another problem.There is a checkbox style column in the datagridview in vb.net.Now The problem is , I wanted to know whether the checkbox in the first row and first cell is checked or not.I mean , can i programically calculate this.
Thanks and Regards
Pankaj
|
|
|
|
|
yes pankaj,
dim row as integer
dim col as integer
row=1
col=1
If DGTimeSheet.Item(col, row).Value = True Then
MsgBox("selected")
End If
priya
|
|
|
|
|
yes pankaj,
dim row as integer
dim col as integer
row=1
col=1
If DGTimeSheet.Item(col, row).Value = True Then
MsgBox("selected")
End If
priya
priya
|
|
|
|
|
hallo pankaj is ur problem solved?;)
priya
|
|
|
|