|
hey!nice to meet you,everyone.you can call me bill.can we make friends?
recently i posted a problem on the forum and havenot had a better answer.i know i am not clever.but could you please help me a little more? my question is:how to serialize(save) object into database field(SQL Server)?for a instance:
<serializable()>_
public class employee
private _name as string
private _age as string
public property name() as string
get
return me._name
end get
set(byval value as string)
me._name=value
end set
end property
.........
then,i serialized(saved) them into file:
public sub save(byval emp as employee,_
byval filepath as string,byval overwrite as boolean)
dim mode as filemode
if overwrite then
mode=filemiode.create
else
mode=filemode.createnew
end if
dim fs as new filestream(filepath,mode)
dim bf as new binaryformatter()
bf.serialize(fs,emp)
fs.close()
end sub
excitedly,i succeed.but,how to serialize(save) them into database field(SQL Server)?i have tried for many times,but failed!(maybe add dataset as interface,but i don't know how to do).please help me.i'm worrying about it.thanks a lot!
good luck and make more money! bill(in forum's name is:maaaxwell)
|
|
|
|
|
I have created several Excel VBA procedures that create a new spreadsheet, query a SQL database, and create pivot tables around the data. I would like to create an Excel function that takes an integer parameter and creates the new spreadsheets. I was able to create an xla file but it will not allow the creation of a new spreadsheet from inside a function. Is there a way to do this without creating a full blown COM object instead of an Excel add-in?
|
|
|
|
|
Hi,
I'm actually trying to show the properties of an object (line) painted on a bitmap in a scrollable control when I click over the line itself.
here is my problem:
the line is "georeferenced", so I wrote a function to convert the mouse coordinates to "geo coordinates" and perform a hit test to select the line.
It actually works if i do not use zoom.
To zoom-in I use a variable "_ScalingFactor" which is incremented by 0.05 by the zoom-in command and which is used to define the bitmap size and the translating function.
so, when i click on the control to select the line, I obtain the coords of the control not the coords of the bitmap containing the lines (the bitmap is larger then the control).
as a consequence, my hit test to select a line fails...
basically i'd need to get the mouse coords over the bitmap not over the control that contains the bitmap itself.
any help is veeery appreciated
Ciao!
Fuel2Run
p.s. sorry for my poor english.
|
|
|
|
|
You need to add the scroll values to get the co-ords to the top left of the image. And then you need to scale by your zoom factor.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian,
you're quite right, but.. how do I get the scroll values from my control?
is AutoScrollPosition property?
I gave a quick try but it's not working, are there more gaps to take into account? (i.e. scrollbars dimension)
if I don't take into account the scroll values, I get the correct coords when the VScrollBar is completely down and the HScrollBar is completely on the right,
if I do, I can't find the proportion with the scaling factor and the hit test fails...
thanks again!
Fuel2Run
|
|
|
|
|
The scroll bar size does not matter, they are on the right and bottom, aren't they ?
The best thing to do in a case like this is to write it out on paper, I've found. Step through the operations taking place to position the image, so you can reverse them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
>The scroll bar size does not matter, they are on the right and bottom, aren't they ?
yes, they are
>The best thing to do in a case like this is to write it out on paper, I've found. Step through the operations taking place to position the image, so you can reverse them.
you're right, i can't actually figure out how the coords go out of scale, maybe, trying on paper, i will
Cheers!
Fuel2Run
|
|
|
|
|
I am generating the columns of datagrid with auto generate column is true.I want to make only one column as hyperlink.How can i do that in vs.I am using vb.net
Thanx in anticipation
Take it easy...
|
|
|
|
|
Im trying to code a mail server using vb6, and i need some help regarding the standrards used in theses kinds of projects, i did have a look at the RFC's but that didnt help much...
Please provide some help...
SS
|
|
|
|
|
saood swar wrote:
Please provide some help...
What is today? Everyone asking "Help?", but noone is saying with what...
All the standards are in the RFC's... It's up to you how you want to implement them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am able to use the AxMsChart in VB.net successfully, however when I try to print directly from it ... it failed!
By working around, I can only print with the screen (x,y) but it is not very good, because the users use different screen solutions. Even worse, sometimes it includes the print box message over the AxMsChart printing
*) Please do not show me in Visual Basic environment, I do not have it and when try to compile --> resulting errors!
Anyone know how to do it from VB.net?
Thanks for any help
|
|
|
|
|
A simple search on Google for "print mschart vb.net[^]" reveals LOTS of hits. Even this[^] article here on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need to have access to a parameter with more than one fuction.
Here is what i have so far and i am stuck. and i am need of help.
I have tried putting the variable at the class level ;however, i am in need to know how to implement this.
Thank you for your help ahead of time.
ERIK...
Dim IDproduct As Int32 = CInt(Request.Params("IDProduct"))
'
'.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'
'
End Sub
Protected Sub PopulateControl2()
'Fill ddlRoomsNames
'
Dim IDAttributeCategoryRooms As Int32 = CInt(Request.Params("IDAttributeCategoryRooms"))
Dim RoomNames As New ConstructionSuperCenter.Global.Global_WindowTreatment
'Get the dll
Dim ddlRoomNames As New DropDownList
'Fill
ddlRoomNames.DataSource = RoomNames.Get_Standard_Blind_Name_of_Rooms_(IDproduct, IDAttributeCategoryRooms)
ddlRoomNames.ToolTip = "Please Choose a Room"
ddlRoomNames.DataTextField = "AttributeName"
ddlRoomNames.DataValueField = "AttributeName"
ddlRoomNames.DataBind()
'
'Place Holder Rooms
'
phRooms.Controls.Add(ddlRoomNames)
End Sub
'
Protected Sub PopulateControl1()
IDproduct = (New SqlParameter("@IdProduct", IDproduct))
Dim IDAttributeCategoryColor As Int32 = CInt(Request.Params("IDAttributeCategoryColor"))
'
Dim StandardColors As New ConstructionSuperCenter.BCom.Wood_and_Alternitive_Blinds_MAIN
'Get the dll
Dim ddlStandardColor As New DropDownList
'Fill
ddlStandardColor.DataSource = StandardColors.Get_Standard_Blind_Colors_(IDproduct, IDAttributeCategoryColor)
ddlStandardColor.ToolTip = "Please Choose a Color"
ddlStandardColor.DataTextField = "AttributeName"
ddlStandardColor.DataValueField = "AttributeName"
ddlStandardColor.DataBind()
'
'Place Holder
'
phColors.Controls.Add(ddlStandardColor)
'
End Sub
End Class
|
|
|
|
|
Erik Lirttle wrote:
I need to have access to a parameter with more than one fuction.
Perhaps you should state which parameter you require access for and what portion of coding you are having problems with.
|
|
|
|
|
I need to have access to the IDProduct parameter that is being requested from the sending page. I am tring to put it at the class level so that i can have access to it class wide, that is where i am running into the trouble.
Also is the cloning method a better way to implement this?
erik..
|
|
|
|
|
It's bad practice, but...
Dim IDproduct As Int32
'
'.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
IDproduct = CInt(Request.Params("IDProduct"))
Catch
' Whatever you want here in case the parameter doesn't exist...
End Try
'Put user code to initialize the page here
'
'
End Sub
Though, your question should be posted in the ASP.NET Forum when dealing with Web Forms, regardless of the language being used.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I Want to Create SMS Service in VB.Net if Somebody helps me, its great for me.
|
|
|
|
|
Help you with what? You haven't asked a question, other than "Who want's in on this?"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
there is a broswer,how to keep the same session when I great a new broswer
|
|
|
|
|
hi all, i have this macro and 9118 record into sheet ABICAB. I have seen in my History link (Cronology of IE) the macro make for each record scanned a new ink!!!!!!!!!!! after onlly 6 minutes of macro run, i have 156 new link into history list acccccc..........
Is possible to not store into history link all page visited with the macro?
part of Column A and Column B
01000 03246
01005 01009
01005 02401
01005 02602
01005 02806
01005 02808
01005 03251
01005 03418
01005 04606
01005 10202
01005 11703
01005 11711
01005 13801
01005 14501
01005 14801
01005 39102
01005 40100
01005 58020
01005 58480
01005 73160
01010 01007
01010 01008
01010 01600
01010 01601
01010 01602
01010 01603
01010 01604
01010 01605
01010 01606
01010 01607
01010 01608
01010 01609
01010 01610
01010 01611
01010 01612
01010 01615
01010 02400
01010 02403
..............
Sub RICERCA_ABI_CAB()
Dim ie As Object
Dim lngRow As Long
Dim lngMaxRow As Long
Dim wksList As Worksheet
Set wksList = ActiveWorkbook.Worksheets("ABICAB")
Set ie = CreateObject("InternetExplorer.Application")
On Error GoTo errHandler
lngMaxRow = Range("A65536").End(xlUp).Row
With ie
.Visible = True
For lngRow = 2 To lngMaxRow
.navigate "http://www.bancaroma.it/abicab/index.asp", 2
Do While .busy
DoEvents
Loop
Do While .ReadyState <> 4
DoEvents
Loop
If wksList.Cells(lngRow, 3).Value = "" Then
With .document.Forms(0)
'Abi
.ABI.Value = Range("A" & lngRow)
'Cab
.CAB.Value = Range("B" & lngRow)
.submit
Application.StatusBar = "Processing row " &
lngRow & " of " & wksList.Range("A1").CurrentRegion.Rows.Count
End With
Do While Not CBool(InStrB(1, .document.URL, "?
search"))
DoEvents
Loop
Do While .busy
DoEvents
Loop
Do While .ReadyState <> 4
DoEvents
Loop
On Error Resume Next
'CONSIDERARE PRIMA CELLA COME POSISZIONE "ZERO"
Range("C" & lngRow) = UCase(.document.all.tags
("table").Item(1).Rows(0).Cells(3).innerText)
Range("D" & lngRow) = UCase(.document.all.tags
("table").Item(1).Rows(1).Cells(3).innerText)
Range("E" & lngRow) = UCase(.document.all.tags
("table").Item(1).Rows(2).Cells(1).innerText)
Range("F" & lngRow) = UCase(.document.all.tags
("table").Item(1).Rows(3).Cells(1).innerText)
Range("G" & lngRow) = Format(UCase(.document.all.tags
("table").Item(1).Rows(4).Cells(1).innerText), "#00000")
On Error GoTo errHandler
End If
Next lngRow
End With
errHandler:
ie.Quit
Set ie = Nothing
Exit Sub
ActiveWorkbook.Save
End Sub
|
|
|
|
|
AFAIK, no, you can't turn it off. Every link that the .Navigate() method visits is recorded in the History. You might want to navigate to the page once, then just Refresh it after that. The refresh won't show up in the History.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Tks, Dave...
But i not have knoledgnment to make your suggestion;-(
Correct, please, a part of my code.
Tks. Sal.
|
|
|
|
|
sal21 wrote:
But i not have knoledgnment to make your suggestion
By this statement, I take it that you didn't write this code?
ie.navigate "http://www.bancaroma.it/abicab/index.asp", 2
With ie
.Visible = True
For lngRow = 2 To lngMaxRow
.Refresh
Do While .busy
DoEvents
Loop
Do While .ReadyState <> 4
DoEvents
Loop
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is my new code, is correct?. Because after the cursor go in:
.refresh
the macro go into ie.quit and and the code!?
Sub RICERCA_ABI_CAB()
Dim ie As Object
Dim lngRow As Long
Dim lngMaxRow As Long
Dim wksList As Worksheet
Set wksList = ActiveWorkbook.Worksheets("ABICAB")
Set ie = CreateObject("InternetExplorer.Application")
On Error GoTo errHandler
lngMaxRow = Range("A65536").End(xlUp).Row
With ie
.Visible = True
For lngRow = 2 To lngMaxRow
.Refresh
.navigate "http://www.bancaroma.it/abicab/index.asp", 2
Do While .busy
DoEvents
Loop
Do While .ReadyState <> 4
DoEvents
Loop
If wksList.Cells(lngRow, 3).Value = "" Then
With .document.Forms(0)
'Abi
.ABI.Value = Range("A" & lngRow)
'Cab
.CAB.Value = Range("B" & lngRow)
.submit
Application.StatusBar = "Processing row " & lngRow & " of " & wksList.Range("A1").CurrentRegion.Rows.Count
End With
Do While Not CBool(InStrB(1, .document.URL, "?Search "))
DoEvents
Loop
Do While .busy
DoEvents
Loop
Do While .ReadyState <> 4
DoEvents
Loop
On Error Resume Next
'CONSIDERARE PRIMA CELLA COME POSISZIONE "ZERO"
Range("C" & lngRow) = UCase(.document.all.tags("table").Item(1).Rows(0).Cells(3).innerText)
Range("D" & lngRow) = UCase(.document.all.tags("table").Item(1).Rows(1).Cells(3).innerText)
Range("E" & lngRow) = UCase(.document.all.tags("table").Item(1).Rows(2).Cells(1).innerText)
Range("F" & lngRow) = UCase(.document.all.tags("table").Item(1).Rows(3).Cells(1).innerText)
Range("G" & lngRow) = Format(UCase(.document.all.tags("table").Item(1).Rows(4).Cells(1).innerText), "#00000")
On Error GoTo errHandler
End If
Next lngRow
End With
errHandler:
ie.Quit
Set ie = Nothing
Exit Sub
ActiveWorkbook.Save
End Sub
|
|
|
|
|
hummmm.....
I test it with PF8 and when the cursor go on .refresh the macro go in ie. quite and exit!?!?
|
|
|
|