|
koolprasad2003 wrote:
just call shell("ipconfig" > "C:\ip.txt")
it will create the text file at location C:\ip.txt
it contains the ip and other things too.
read it and get information
The real question is, would you do that in your project?? Would you create a text file each time and read from it every time you want the ip address? I'd bet that no customer would accept such a solution.
SG
|
|
|
|
|
Can u help GS? PLZ?
phatkin
|
|
|
|
|
WMI [^]is a good option.
This[^] may also help.
SG
|
|
|
|
|
Thanks...would work that out
Actually am working on a chat application in vb.net where it is asynchrounous and that each macine is act as a server and client and i wanted a way of displaying all computers on an LAN.
phatkin
|
|
|
|
|
|
no not ip messenger. this is smaller than that one fo ra project.
am trying to use shell cmd net view to get the computers and use a text file cos i can see my way around the rest but the storing to the text file gives me problems says file not found
phatkin
|
|
|
|
|
ERROR:Format() is a type and cannot be used as an expression
Why is it this function works smoothly in VB.NET 2003?
Format(1234, "0000")
but when i try to used it in Visual Basic 2005
an error occurs just like this...
'Format' is a type and cannot be used as an expression
here's my code:
****************************************
Function AutoGenerateEmpID(ByVal strSQL As String) As String
Try
Dim strID As String
Dim strCharYr As String
Dim strDigit As String
openDB() 'this is just my customized function..
dbRecordset.Open(strSQL, dbConnection)
strDigit = Format(Val(dbRecordset.Fields("IDNo").Value) + 1, "0000") 'my error occurs here...
strCharYr = Microsoft.VisualBasic.Right(Year(Now), 2)
strID = strCharYr & "-" & strDigit
'dbRecordset.Fields(0).Value
closeDB() 'this is just my customized function..
Return strID
Catch ex As Exception
MsgBox(ex.ToString())
End Try
End Function
***************************
Note: expect that dbRecordset.Fields("IDNo").Value returns an numbers which is in the form of string
***********************************
Please help....
I cant figure it out my self why is that so??
Is it there something i just forgot to imports some namespace or what??
Please help...
Thanks in advance!!
|
|
|
|
|
VB2005 obviously removes still more VB6 nastiness. You need string.Format
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
HI ALL,
I WOULD LIKEE TO EXPORT THE ACCESS DATABASE TABLE DATA IN EXCEL FROM VB6.0.I USED ADO REFERENCE TO CONNECT THE DATABASE.HOPE FOR QUICK SOLUTION.
PAWAN
-- modified at 5:12 Wednesday 22nd August, 2007
|
|
|
|
|
Hi,
I am using oracle to connect to the db and I have written the below code in vb.net. Any way u can try it and feedback me.
imports Microsoft.Office.Interop
Dim xl As New Excel.Application
xl.Workbooks.Add()
xl.ActiveSheet.Name = "Cash Report"
xl.Visible = True
j = 1
l = k = 0
For i = 1 To n - 1
j = 1
l = 0
For l = 0 To 4
xl.Cells(i, j) = ds.Tables(0).Rows(k)(l)
j = j + 1
Next
k = k + 1
Next
Ahamed Azeem
Software Programmer
Saudi Postal Technologies – Riyadh
|
|
|
|
|
in vb 6.0 we can use the referance of the excel library.i used the excel library and export the data but my problm is that i have to already create excel file in certain location and display the record in that file .but i want to export the data with out creating excel file already.(have u undestood or not if not noty fy me)
|
|
|
|
|
Do u need to update the data into the same excel which was created earlier?
-- modified at 6:12 Wednesday 22nd August, 2007
Ahamed Azeem
Software Programmer
Saudi Postal Technologies – Riyadh
|
|
|
|
|
I DO NOT LIKE TO USE THE EARLIER CREATED EXCEL FILE.I WANT TO CREATE NEW.
|
|
|
|
|
Hi,
The following code snippet will create a new excel file.
Dim xl As New Excel.Application
xl.Workbooks.Add()
xl.Visible = True
Ahamed Azeem
Software Programmer
Saudi Postal Technologies – Riyadh
|
|
|
|
|
hi
sorry that code is not worked.simply i want to expor the data in excel by using vb 6.0 .my data base is MS Access.
|
|
|
|
|
Hi,
Please import the reference of microsoft excel(its a com file) into your application and then try. Because its working fine with my application.
Ahamed Azeem
Software Programmer
Saudi Postal Technologies – Riyadh
|
|
|
|
|
Did you try using the DTS Wizard option that comes with SQLServer. There is an option to transfer between heterogenous data sources in it.
|
|
|
|
|
Your CAPS-LOCK key seems to be most probably on. Typing in ALL-CAPS normally indicates a bad temper (viz) shouting. It may also indicates an amateurish attitude in a public discussion forum.
|
|
|
|
|
Dear Everyone.....
Hope you will be in best of your health....
I have an immediate assignment from my boss to collect the knowledge that what are the best practices & architecture to deal with databaes, tables using vb .net...
Actual problem is that i want to know simply that what way i should adopt for the subject. weather i should go with using data source managers or i should create objects, classes, procedures or whatsoever is...
i can quote an example of my question as;
CONTROL --> DATABINDINGS --> DATASOURCE -->
DATA-ADAPTER-->DATABASE
please help me...
thanks
Khurram
|
|
|
|
|
Your boss wants you to learn how to properly write a database application ?
I'm all for a seperate data layer, and all SQL in stored procs. Some people swear by ORMs.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear Graus,
thank you so much for the immediate response....
you have gotton my problem.... i am going for a one-hour presenation, so how i can describe in detail about the data layer...
my problem is not actually the conversion but to find out the exact model which i should follow to deal with my databases.
i mean what is the best method to deal with records that saves my memory, facilites me more, etc. etc.
please disclose more if you can....
thanks
|
|
|
|
|
Hi,
At a minimum you'll need to cover:
* Ad-hoc data access
* Stored procedure based DLs
* Custom business objects
* Template based ORM / Handmade ORM
* ORM mapping tools.
That list is pretty much in order from most-flexible to least-flexible, but also from most-effort to least-effort (in general). Your boss wants to hear about what the upfront cost is, how quick you can develop, how reliable your code will be, and the maintainance cost if things need to be changed.
Remember your boss is less interested in the technical details, and more interested in the risks and benefits of your choices!
I have to admit a certain bias towards ORM, as my company sells ORM tools. For a presentation you can certainly find a lot of "boss friendly" material on how ORM tools will benefit your development process on the site linked in my signature. Although we are writing about our products - the general gist applies to a lot of ORM tools.
|
|
|
|
|
Dear friend,
thanks once again for the nice response...
you are absolutely right in your sense.
I am just telling you the whole story of my last meeting with my boss. He is very conceptual and technical person. he is highly able to criticize the matters.
he is straight forwardly asking me the following questions
1. What is .net framework's internal architecture?
2. What are database oriented best practices in .net?
3. how would be application design in .net?
4. overview of .net studio?
5. .net framework multilanguge support?
6. Database access (recordsets, queries, classes, parameters)
7. What is the best way to insert, delete, find and update data?
other topics i have covered approximately. but now i am concentrating on database oriented best practices..
hope now you are very clear about my problem
|
|
|
|
|
khurramsheraz wrote: He is very conceptual and technical person. he is highly able to criticize the matters.
But, neither he nor you know the answers to these questions ?
1 - who cares ? If you don't know the basics, they are a google away. Anything more than that doesn't matter, certainly to database code
2 - The main thing is to let the .NET connection pool do it's work. Otherwise, no different to any other language
3 - n-tiered is always the best approach, IMO
4 - WHAT ? Have you not used it before ?
5 - resource files
6 - Buy a book on ADO.NET
7 - SQL
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
It also depends on how big the company is and how many different database applications are required.
I have certainly seen cases where ORM is simply not necessary because the company and /or the requirements arent too Big.
I am a big fan of a 3 tier approach myself
Dumb Database Layer - gets/upserts the data - if written correctly with abstract factories for each type of database (SQL, Oracle, Web Service etc.)
Once this is written it can be used everywhere and only needs changing when a new type of database is going to be used.
Business Layer - derived from a stongly created Base Class which holds the business rules for processing data entities. For example a User Business component or an "Order" Business component. In my case each busines component would be capable of navigating row by row or presenting a modified dataset for binding to gui.
The business layer would be where most of the on going maintenance would occur. It would hold all the business rules. Ie you change the users details , therefore generate an audit record.
These components could be stored in a different process or server if required.
Gui/Controller layer - This takes the data from the business layer and adds it to the Gui controls and then takes any changes and passes them to the business layer- it includes some gui based validation rules ie a field is just number or a date, that kind of thing.
Personally I think, for a small to perhaps medium sized company, that this gives the best framework in terms of long term maintenance costs and ease of use.
Yes its a bigger pain than just binding data to controls from within each app but once the initial overhead is taken care of I see this as a very robust solution.
Hope this helps
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|