|
Hy! I'm sorry if i can't explain my problem very well, i'm italian but i need help for a problem with vb.net program... so...
I make a web service that extract some value from a db and this result must be insered in this public structure:
<br />
Public Structure SERVS1Result<br />
Public NumeroComm As Integer<br />
Public Comm As SComm<br />
<br />
Public Structure SComm<br />
Public Nome As String<br />
Public Indirizzo As String<br />
Public Cap As String<br />
Public Comune As String<br />
Public SiglaProvincia As String<br />
Public Email As String<br />
Public telefono As String<br />
End Structure<br />
End Structure<br />
the result that i must receive for 2 record extract, is this for examp:
<soap:envelope xmlns:xsi="
"http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd="
"http://www.w3.org/2001/XMLSchema"" xmlns:soap="
"http://schemas.xmlsoap.org/soap/envelope/"">
<soap:body>
<servs1response xmlns="http://www.contoso.com/Response">
<servs1result>
<numerocomm>int
<comm>
<scomm>
<nome>string
<indirizzo>string
<cap>string
<comune>string
<siglaprovincia>string
<email>string
<telefono>string
<scomm>
<nome>string
<indirizzo>string
<cap>string
<comune>string
<siglaprovincia>string
<email>string
<telefono>string
I wrote this code:
<br />
Public Function SERVSUPP001(ByVal ist As String) As SERVS1Result()<br />
<br />
.........code..........<br />
<br />
If Not risolvi = "" Then<br />
objConn.Open()<br />
<br />
Dim Com() As SERVS1Result 'Giusto<br />
<br />
Dim pec As String<br />
Dim i As Integer = 0<br />
Dim x As Integer = 0<br />
Dim c As Integer<br />
Dim objCmd2 As New OleDbCommand("ConnectionString", objConn)<br />
Dim objReader2 As OleDbDataReader<br />
objReader2 = objCmd2.ExecuteReader<br />
<br />
While objReader2.Read<br />
pec = (objReader2.GetString(9))<br />
If pec = "Y" Then<br />
ReDim Preserve Com(i)<br />
<br />
Com(i).Comm.Nome = objReader2.GetString(2) 'Sede<br />
Com(i).Comm.Indirizzo = objReader2.GetString(4) 'indirizzo<br />
Com(i).Comm.telefono = objReader2.GetString(5) 'telefono<br />
Com(i).Comm.Email = objReader2.GetString(8) 'email<br />
Com(i).Comm.Cap = CapCom<br />
Com(i).Comm.Comune = Comune<br />
Com(i).Comm.SiglaProvincia = Provincia<br />
i = i + 1<br />
End If<br />
<br />
End While<br />
<br />
objConn.Close()<br />
objConn.Dispose()<br />
<br />
<br />
Return Com<br />
<br />
End If<br />
<br />
<br />
End Function<br />
but my result is that all the structure is replicate for each record and i need only to replicate the second structure in the first structure, this:
<br />
Public Structure SComm<br />
Public Nome As String<br />
Public Indirizzo As String<br />
Public Cap As String<br />
Public Comune As String<br />
Public SiglaProvincia As String<br />
Public Email As String<br />
Public telefono As String<br />
End Structure<br />
Can you help me please?
-- modified at 9:29 Monday 17th July, 2006
|
|
|
|
|
Hi!
Can anybody guide me how to set a vb application run as a service in windows XP?
Thanks!
|
|
|
|
|
Assuming you have the source code, two options off the top of my head.
1. If this is VB 6, you can use the 'Microsoft NT Service Control' (ntsvc.ocx); search the web for it and documentation on how to use it.
2. If this is a VB.Net application, write it is a service.
|
|
|
|
|
I'm writing a simple tool to take backup of folders in a LAN. THe problem is, many clients on the network use multi-language Windows OS. So I'm not able to read folders written in, say, chinese language. On server the folder is shown as "??????" and so when I try to access that folder in the path, it shows "path not found" error. Any help to solve this problem would be highly appreciated.
|
|
|
|
|
I am writing a Javascript (AJAX) to hit a server side code.
The Server side code is called when the Javascript is executed for the first time and the readystate is 1.
But when I am trying to hit it again, the server side code is not hit and the ready state is shown as 4.
I'm trying to hit the server side code everytime the AJAX code is executed.
Please find the code below:
function confirmExit() {
var request = false;
var uri = "test1.aspx";
alert("State:" + request.readystate);
if (window.ActiveXObject) // for IE
{
request = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) // for other browsers
{
request = new XMLHttpRequest();
}
request.open("GET",uri, true);
request.send(null);
}
Vikas
|
|
|
|
|
hi i had treeview which is filled form databse.when i add new item and update the treeview(refill it) then it collapses,can i get its previous position and reopen it at that pt where it was /or prevent it from collapsing. Thank in advance
Tasleem Arif
|
|
|
|
|
Hi there.
Just make a tempory vairable of the selected node in the treeview and after reload it from the database set the treeview's selected node to the tempory node.
Example:
Dim tempNode as TreeNode
tempNode = trView.SelectedNode
'''Reload from database
trView.SelectedNode = tempNode
trView.SelectedNode.EnsureVisible
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
i had used that code in the after select event of treeview and it give the exception below.
object refrence not set to the instance of object
which i caught in try catch block
Tasleem Arif
-- modified at 2:56 Tuesday 18th July, 2006
|
|
|
|
|
Are you sure you used the right namespace for your treeview? trView represent the treeview’s name you use. This code I gave you should work, I’m using it myself.
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
Dear all,
I have a large database in Access and I want to convert it to an Excel file with many sheets using VB6. But I do not know how to do it.;P
Please tell me!
Thank you very much!
Chau Nguyen
|
|
|
|
|
What do you mean by "large Access database"? How many records??
Excel is grossly inefficient at storing large amounts of data. Each sheet can only hold just over 65,500 rows. Excel can easily run the machine out of RAM long before you get to "many sheets".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have over 72 thousands records. So I really need convert database to Excel file having many sheets.
|
|
|
|
|
OK. So see how much memory your Excel sheet will take. I think you'll be surprised. 72,000 records will take 2 sheets. Create a single row that simulates the data you'll be importing, then copy it to ALL the rows in the first sheet. If your survive that, go to the second sheet and try to fill in the first 10,000 rows. Depending on your system, you MIGHT be able to fill it in...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hic hic, it is overflow when I run it. Is there any way to load database from into Excel sheet not row by row? I have tried to do that and it is OK if my database is smaller than 65.000 rows. How about over 72.000 rows?
|
|
|
|
|
chau198 wrote: Is there any way to load database from into Excel sheet not row by row
Nope. The only way you're going to handle the overflow onto the next sheet is to import the database, row-by-row, in your code. This, of course, will take an eternity in Excel.
Excel is just not a good candidate for handling this many rows. It's not what it was designed for. You're better off leaving the data in Access and using other methods for whatever your doing.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Does anyone know where I can find the DotNetNuke DAAB code? I have downloaded the source SDK, and I am looking for examples on how they insert, update, and delete records using Microsoft's DAAB. I have search through the various namespaces, but could find nothing.
Regards,
ma se
|
|
|
|
|
Why not Google for "dotnetnuke DAAB[^]"?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please help me how to set connection pooling in vb6.0 and backend sql server?
-- modified at 7:57 Monday 17th July, 2006
|
|
|
|
|
A LOT more detail about what your doing with connection pooling is required. By default, ADO.NET does this automatically. But in a single-user app, unless your doing LOTS of database transactions in a short amount of time, connection pooling won't do you much good. It's biggest performance benefit only works server-side, such as in a web application where many clients are asking the website to connect to the database quickly at the same time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
HIE,
I 'm making a address book type application and i need to add an export to word function.I want to be able to write data into a table in a word file.Is this possible and how would i go about it?? if it is possible??
I had a wierd idea .. what if i made the table in a richtextbox (i dont know how to do that~!)And then write that data into a .doc file?.
also what about just printing the table .. what do i have to look up to just make a File->Print fuction that would have the table printed!??
i really need this please , this is the third forum i've put this question on!!
i atleast need the print question answered!!! i really need this PLEASE!!!
PS . i need to know how to do this in VB6 code cuz.. i'm still not very clear with .NET concepts!
Thanks
Gideon
-- modified at 13:25 Friday 14th July, 2006
|
|
|
|
|
The RichTextBox doesn't know anything about Words .DOC file format, so won't support them. Word, on the other hand, understands .RTF (Rich Text Format) documents without any problem.
You can use the Word COM object model by adding a Reference to the "Microsoft Office ... Object Library". You can then create your table or manipulate Word any way you like. See this[^] for an example.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
ok , i got the source!
Sub OptimizePerformance(ByRef doc As Word.Document)<br />
doc.Windows(1).View = wdNormalView<br />
With doc.Application<br />
.Options.Pagination = False<br />
.ScreenUpdating = False<br />
End With<br />
End Sub
wat does word.document refer to!?? a .doc file!??
plz reply quick i really need this!
|
|
|
|
|
giddy_guitarist wrote: wat does word.document refer to!?? a .doc file!??
What does the name suggest to you? Of course it does! It's not the file though, it's represents one of the documents Word has open.
giddy_guitarist wrote: plz reply quick i really need this!
Then call a consultant. The forums on any site are an all volunteer effort. People do not man these forums 24 hours a day, just waiting for a question to pop up. We answer them whenever we can, in the time we have available to us. We all have our own lives too...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi everyone!
I need to display the save changes message box in my windows form if user try to close the form without saving data.so can anyone help me to do this pls/
|
|
|
|
|
ok , first You have to set a flag/variable to go "true" when theres a change
Then u add the code :
<br />
Private Sub Form_Unload(Cancel As Integer)<br />
If change = True Then<br />
Select Case MsgBox("The text has changed." + Chr(13) + "Do you want to save the changes", vbYesNoCancel")<br />
Case vbYes<br />
'Code for saving <br />
Cancel = 0'This unloads the form<br />
Case vbNo<br />
Cancel = 0'Same here<br />
Case vbCancel<br />
Cancel = 1 'This stops the form frm being closed!<br />
End Select<br />
End If
Hope that helped!
Gideon
|
|
|
|