|
|
Hi all,
Can anyone roughly tell me how to:
1) Setup a WAN networking for ul/dl of sys OS images
2) Establish LAN peer to peer link to various levels in a company and also to a central database that is remotely located in another country.
Will greatly appreciate any reply!
Thanks
|
|
|
|
|
andylimjp wrote: 1) Setup a WAN networking for ul/dl of sys OS images
There is no one setup for this and the process of imaging a machine doesn't care what kind of network it's going over. Although, since O/S images tend to be quite large, you'll want any links that these files go over to be pretty fast, and in a WAN environment, this means pretty expensive.
andylimjp wrote: 2) Establish LAN peer to peer link to various levels in a company and also to a central database that is remotely located in another country.
There isn't enough detail in this question to give any meaningful answer. "Peer to Peer" link can mean anything. What are you trying to do with this "link".
Connecting to a database, no matter where on earth it is, is the same as if it was sitting next to you. That exact procedure of which depends on your database servers requirements.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everyone
I have a problem and that is I want to be able to get the Mp3 files that are in my directory and place them in a Listview.once it has done that I want it too automatically generates an XML with all the songs in that directory.
any ideas or where i can look for help ??
thanks alistair
|
|
|
|
|
Can someone please help me in resolving the following issue.
I have tried to reinstall 3 times now vb6 and when I go to viewcode all is great but when I click on designer then the program crashes. I looked in the Application error log and noticed the following error. Ven1000 Hex 0x000581F1 error on the VB6 exe file.
I have updated active x hoping that would resolve the issue. Also this is on a network with folder redirection enabled if that helps.
thanks
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
Not a clue. AFAICT, Ven1000 doesn't have anything to do with VB. Have you scanned the machine for viruses and spyware??
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I am coding in VB.net 2003
I have created a datagrid on the form called "Line Grid" and I am populating in the code through a sql statement. see below
How do I get the content of a specific row and colum in the grid?
Dim MY_SQL As String, TMP1 As String
Dim DATABASE_NAME As String
Dim tblCrrncMngr As CurrencyManager = CType(BindingContext(CODE_DataSet.Tables.Item(CODE_TABLE)), CurrencyManager)
Dim MYDATACOL As New DataGridTextBoxColumn
LINEGrid.TableStyles.Clear()
DATABASE_NAME = DATA_PATH 'c:\quote.mdb"
CODE_TABLE = NEW_TABLE '"INMASTER"
MY_SQL = "SELECT * FROM " + NEW_TABLE
OleDbDataAdapterARMaster.SelectCommand.CommandText = MY_SQL
CODE_Data_Adapter = New OleDbDataAdapter(MY_SQL, CONNECT_STRING)
CODE_Data_Adapter.TableMappings.Add("Table", CODE_TABLE)
' Fill the DataSet.
CODE_DataSet.Clear()
CODE_Data_Adapter.Fill(CODE_DataSet)
With LINEGrid
.SetDataBinding(CODE_DataSet, CODE_TABLE)
.Refresh()
End With
With MYDATACOL
.MappingName = "QUOTE_NO"
.HeaderText = "QUOTE NUMBER 123"
.Width = 200
End With
With MY_TBL_Style
.MappingName = CODE_TABLE
'Set column styles
With .GridColumnStyles
.Add(New DataGridBoolColumn)
With .Item(0)
.MappingName = "COPY_LINE"
.HeaderText = "FLAG"
.Width = 50
.NullText = String.Empty
End With
.Add(New DataGridTextBoxColumn(tblCrrncMngr.GetItemProperties.Item(CODE_TABLE)))
With .Item(1)
.MappingName = "OPTION"
.HeaderText = "OPTION"
.Width = 100
.NullText = String.Empty
End With
.Add(New DataGridTextBoxColumn(tblCrrncMngr.GetItemProperties.Item(CODE_TABLE)))
With .Item(2)
.MappingName = "QUOTE_LINE_NO"
.HeaderText = "LINE NUMBER"
.Width = 100
.NullText = String.Empty
End With
End With
End With
LINEGrid.TableStyles.Add(MY_TBL_Style)
|
|
|
|
|
Dim TableRow As DataRow
For Each TableRow In CODE_TABLE.Tables(0).Rows
If TableRow.Item(0).ToString = "P" Then
...
End If
If CDec(TableRow.Item(1)) > 0.0 Then
...
End If
Next
Lost in the vast sea of .NET
|
|
|
|
|
How does this work?
"CODE_TABLE" is a string variable for my MSAccess database table (TMP_DATA).
1) do I need to create a "DataTable" type variable?
2) if yes how would I implement it into my above code?
|
|
|
|
|
First let me say, that like your username says, I'm also a New_Coder. I've been working with .NET for three years off an on, and I'm starting to feel somewhat comfortable working with it, but I know I've only scratched the surface. In the shop where I work, I actually code most days on a mainframe in COBOL.
My examples are based on what I've figured out and received CodeProject message board feedback on regarding SQL. My examples are using SQL, but hopefully you can use the ideas and translate them for your use with Access.
My example was working with a data table. I've found it easy to load my data from SQL tables to a dataset and attach the dataset to the grid using the datasource logic. At this point it is easy to manipulate the datagrid data by referencing information through the dataset.
Here is the SQL example I have. Hopefully you can use the logic I have and adapt it to your logic with ACCESS.
Dim MyDataset As New DataSet<br />
Dim MyTable As New DataTable<br />
Dim sqlCN As SqlConnection<br />
Dim sqlda As SqlDataAdapter<br />
<br />
sqlCN = "... connection string... "<br />
sqlSql = "... SELECT Statement or Stored Procedure name ... "<br />
sqlda = New SqlDataAdapter(strSql, sqlCN)<br />
sqlda.Fill(MyDataset)<br />
<br />
MyTable = MyDataset.Tables(0)<br />
<br />
dgrMyGrid.DataSource = MyTable<br />
Once you've filled the dataset, you can use the logic I posted previously to access information in the table.
Lost in the vast sea of .NET
|
|
|
|
|
hi
It will be greatful to help in this technolgy as i m new to this....
I am doing the database connectivity in OleDBConnection and my database is Msaccess...
I want to search thru the records in the table and display a particular record...Thus i need some condition as in rs.EOF or rs.move next in vb....So wat will be the same in vb.net.
Please help me in this...
Thank u.
With regards,
Paddu
|
|
|
|
|
Use the recordset.length property. Setup a loop to iterate through the records.
Dim x as integer
For x = 0 to rs.length - 1
Debug.writeline(rs.tables(0).Rows(x)(columnindex).ToString())
Next
Of course you could set a primary key, setup views/filters, alter stored procedures all to find the one record you need.
|
|
|
|
|
KaptinKrunch,
I dun ve recordset....I ve only dataAdapter and dataSet in vb.net...
So how do i do it?
Thx for ur reply ya....
Paddu...
|
|
|
|
|
I ve a database named ATIS.mdb.In that my table is ATIS_hotel,i am having 3 textboxes and a command button...when i enter some value in the first text box and click the command button,it will be connected to the database and it should retrieve the values of the other two fields in the other two text boxes...
this is my code....
Dim con As New OleDb.OleDbConnection
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = D:\ATIS.mdb"
con.Open()
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
sql = "SELECT ATIS_hotel.area,ATIS_hotel.category FROM ATIS_hotel"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "hotel")
'TextBox1.Text = ds.Tables("hotel").Rows(0).Item("name")
TextBox2.Text = ds.Tables("hotel").Rows(0).Item("area")
TextBox3.Text = ds.Tables("hotel").Rows(0).Item("category")
con.Close()
so how do i retrieve it in the other two text boxes??
Paddu...
|
|
|
|
|
hi, You have said "when i enter some value in the first text box and click the command button,it will be connected to the database and it should retrieve the values of the other two fields in the other two text boxes".
if this is the case, then you need to use the code below to search the dataset for the textbox1 value and retrieve the other corresponding values.
Firstly alter your sql statement and select the hotel name as well. the use the code below to retrieve the values:
Dim foundRows As DataRow()
Dim row As DataRow
foundRows = dataset.Table.Select("hotelname = '" & Trim(textbox1.text) & "')
For Each row In foundRows
AREA = row("area").ToString()
CATEGORY = row("category").ToString()
Next row
I hope this is helpful to you.
With Best Regards,
Mayur
|
|
|
|
|
Visual Basic, Windows XP, reading an NTFS drive.
I'm trying to read in x number of bytes from a drive starting at y position. No matter what I do, readFile is always reading from the first byte.
Example:
If I want to read in the first 512 bytes of data I use:
' -----------------------------------------------------------------------
tempPosition = SetFilePointer(lDevice, 512, 0, FILE_BEGIN)
ReDim Buffer(512)
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
' -----------------------------------------------------------------------
And this works just fine. Now if I want to read 512 bytes, STARTING from the 53248th position I am using:
' -----------------------------------------------------------------------
tempPosition = SetFilePointer(lDevice, 53248, 0, FILE_BEGIN) ' Moving to the new position
tempPosition = SetFilePointer(lDevice, 512, 0, FILE_CURRENT) ' Should move FROM the current position (53248)?
ReDim Buffer(512)
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
' -----------------------------------------------------------------------
The result? I get the exact same thing. It reads from Byte 1 to 512. It's totally ignoring the fact that I already set the file pointer to 53248.
I'm obviously doing something wrong and/or my logic is fuzzy. Can someone please help me.
Thanks
|
|
|
|
|
Does your Declare for SetFilePointer look like this (taken from PInvoke.net):
Public Enum EMoveMethod As UInt32
FILE_BEGIN = 0
FILE_CURRENT = 1
FILE_END = 2
End Enum
<DllImport("kernel32.dll", SetLastError:=True)> _
Shared Function SetFilePointer( _
ByVal hFile As IntPtr, _
ByVal lDistanceToMove As Integer, _
ByRef lpDistanceToMoveHigh As IntPtr, _
ByVal dwMoveMethod As EMoveMethod) _
As System.UInt32
End Function
Public Const INVALID_SET_FILE_POINTER As Integer = -1
You can't pass that DistanceToMoveHigh as a normal Integer type. When the two fields that make up the offset (DistanceToMove and DistanceToMoveHigh) are combined inside the function, the result will be incorrect if passed in as an Integer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My declare looks like this:
Public Declare Function SetFilePointer Lib "KERNEL32" _
(ByVal hFile As Long, _
ByVal lDistanceToMove As Long, _
lpDistanceToMoveHigh As Long, _
ByVal dwMoveMethod As Long) As Long
Which is pasted directly from the API Viewer.
I check the return value (tempPosition) after the call is made and it returns the new file position exactly as I asked it to. So it appears to work just fine. But when I attempt to use ReadFile, it ignores the file position. In fact, if I don't set the file pointer at all, it makes no difference (default is the beginning of the file).
|
|
|
|
|
Are you using VB6 or VB.NET???
This decalre will cause LARGE problems if you used it in VB.NET!! Long's in VB6 are 32-bit signed integers. In VB.NET, they're 64-bit!!!
Use the delcare I posted already. It might just fix your problem...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
IH8Microsoft,
Put in your overlaped structure, even if your not using it, don't call it null, when you are working with devices.
I've come accross that problem with VB6 sp6 on XP sp2 & W2K3 sp1 before.
There may be somthing else I can't see in your little amount of code.
But give it a try, see if it helps...
progload
|
|
|
|
|
Thanks for the suggestion, actually that's what I'm doing.
module:
Public Type OVERLAPPED
Internal As Long
InternalHigh As Long
offset As Long
OffsetHigh As Long
hEvent As Long
End Type
function:
Dim tempNull As OVERLAPPED
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
"tempNull" is an overlapped type. I know that the name tempNull is not obvious, it's just a temp name.
|
|
|
|
|
Does anyone have sample code, just the setFilePointer and readFile parts, that successfully reads bytes starting beyond the 1st?
|
|
|
|
|
|
I've seen that before, actually I have the source from the "Direct read/write disk access" thread.
It's buggy at best. It seems to read Fat drives ok, but fails to read NTFS. Also, after stepping through it, I discovered that he does not get the correct values for a lot of things. For example, in one section he is looking for BytesPerSector. If it isn't retrieved, he just hard codes in 512. That takes place throughout the code and nothing is reliable.
The one thing that does seem to work is the setFilePointer part. Unfortunately I am using the exact same call and it is not working the same.
I imagine that my problem has a simple solution, I just can't seem to find it.
Just to be sure that we're all on the same page (as sometimes I'm not all that clear) everyting is working fine and not failing at any point, it's just that I can't get readFile to START reading after the 1st byte. IE. it is always starting it's read at the 1st byte no matter what I set the file pointer to.
Thanks
|
|
|
|