|
Hello,
I want to develop an application that can display me the IP address of any device, may it be Mobile or another PC or any device that has an IP address, when connected to my PC via LAN Cable.
for eg. if my PC IP is 192.168.1.1 and another device IP is say 65.62.1.10, then how can i get the device IP address after connecting the device with LAN Cable.
I want to Develop using VB.net, so anyone can help me in this case.
Any idea would be of great help.
Thanks in Advance, awaiting for replies.
|
|
|
|
|
You don't know how TCP/IP works, do you?
If you directly connect a device to your PC's ethernet card using a crossover cable, the device you connect has to have an IP on the same subnet as your PC, otherwise, you won't be able to talk to it at all.
|
|
|
|
|
Hello,
Dave Thanks For the reply.
I Know What you said is correct, but then that is exactly what my query is.
I tell you, we use one device which is COM to LAN Converter.
Now this device has it's own IP Address, which we can set acc. to our network settings.
Now this device manufacturer has a software where in when the device is connected to the PC, it displays the IP address of the device regd. of whether it matches with network or no.
Also we can then change the IP Address from the software.
So how come this software is able to get the IP Address even if it is not as per our network settings.
Could you give some info. on this.
Thanks In Advance.
|
|
|
|
|
Your going to have to ask the manufacturer how the device is discovered. I'm thinking the device might be broadcasting an advertising packet of some kind that the software listens for.
You can see if this is true by using a network sniffer, like Ethereal[^].
|
|
|
|
|
I'm trying to use smo to create an insert stored proc which returns the identity of the newly created row.
Here's my code, which returns a "create failed" message without other relevant details.
(The mMyDatabase reference in the code is a Microsoft.SqlServer.Management.Smo.Database that has been successfully connected to. I can post the code for that part if you need it.)
Public Sub AddInsertActivityStoredProcedure()
Dim Name As String = "InsertActivityRow"
If mMyDatabase.StoredProcedures.Contains(Name) Then
mMyDatabase.StoredProcedures(Name).Drop()
End If
Dim An_SP As New StoredProcedure(mMyDatabase, Name, "dbo")
'An_SP.TextHeader = "???"
An_SP.TextMode = False
An_SP.AnsiNullsStatus = False
An_SP.QuotedIdentifierStatus = False
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@UserFK", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@MachineFK", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@ActivityDate", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@Activity", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@TableAffected", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@RowAffected", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@NewPK", DataType.Int))
An_SP.TextBody = "set nocount on" + NewLine
An_SP.TextBody = "INSERT INTO [ADV4SQL].[dbo].[ADVActivities]"
An_SP.TextBody += " ([AcUserFK]"
An_SP.TextBody += " ,[AcMachineFK]"
An_SP.TextBody += " ,[AcDate]"
An_SP.TextBody += " ,[AcActivity]"
An_SP.TextBody += " ,[AcTableAffected]"
An_SP.TextBody += " ,[AcRowAffected])"
An_SP.TextBody += " VALUES"
An_SP.TextBody += " (@UserFK"
An_SP.TextBody += " ,@MachineFK,"
An_SP.TextBody += " ,@ActivityDate, "
An_SP.TextBody += " ,@Activity, "
An_SP.TextBody += " ,@TableAffected, "
An_SP.TextBody += " ,@RowAffected, )" + NewLine
An_SP.TextBody += "@NewPK= SCOPE_IDENTITY() " + NewLine
An_SP.Create()
End Sub
modified on Sunday, May 17, 2009 4:41 PM
|
|
|
|
|
You might want to export to script an existing stored procedure using SQL Server Management Studio first. Take a look at what it output, then you can model your code to create an equivilent string. It doesn't look like adding NewLines at the end of each statement is a valid statement terminator to SQL Server.
|
|
|
|
|
FYI: Your OP replied to himself instead of you.
|
|
|
|
|
Thanks, Dave.
The NewLine was just environment.newline in a var.
I took them off and made sure there were spaces at the beginning or end of each chunk, so that the problem wouldn't be a syntax error.
I did create the stored procedure based on code generated for an INSERT on the ADVActivities table, which has 7 fields including the primary key.
I am new to stored procedures and I can't see how to take the auto-scripted code for INSERT and make a stored procedure out of it.
|
|
|
|
|
Is the scripted SQL marked up with anything?? Like Go statements, semi-colons, whatever...??
|
|
|
|
|
If I take the .TextBody string that this sub creates, and paste it into SQL Server Management Studio in a new Stored Procedure window, and press "Execute", the stored procedure is created perfectly.
If I run this sub, it fails.
(The mMyDatabase var is populated with a properly-connected database/connection.)
I've tried removing the BEGIN/END items, removing the parameters, changing the .TextMode, the .AnsiNullsStatus, the .QuotedIdentifierStatus, in every combination I can think of, and it still fails.
Thanks for any help!
Public Sub CreateInsertActivityStoredProcedure()
Dim Name As String = "InsertActivityRow"
If mMyDatabase.StoredProcedures.Contains(Name) Then
mMyDatabase.StoredProcedures(Name).Drop()
End If
Dim An_SP As New StoredProcedure(mMyDatabase, Name, "dbo")
'An_SP.TextHeader = "???"
An_SP.TextMode = False
An_SP.AnsiNullsStatus = False
An_SP.QuotedIdentifierStatus = False
'these are the input paramters
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@UserFK", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@MachineFK", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@ActivityDate", DataType.DateTime))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@Activity", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@TableAffected", DataType.Int))
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@RowAffected", DataType.Int))
'this is the output parameter
Dim An_OutputParameter As StoredProcedureParameter = New StoredProcedureParameter(An_SP, "@NewPK", DataType.Int)
An_OutputParameter.IsOutputParameter = True
An_SP.Parameters.Add(An_OutputParameter)
'start the string (the rest use += )
An_SP.TextBody = ""
An_SP.TextBody += "CREATE PROCEDURE InsertActivityRow"
An_SP.TextBody += " @UserFK int,"
An_SP.TextBody += " @MachineFK int,"
An_SP.TextBody += " @ActivityDate datetime,"
An_SP.TextBody += " @Activity int,"
An_SP.TextBody += " @TableAffected int,"
An_SP.TextBody += " @RowAffected int,"
An_SP.TextBody += " @NewPK int OUT"
An_SP.TextBody += " AS"
An_SP.TextBody += " BEGIN"
An_SP.TextBody += " SET NOCOUNT ON"
An_SP.TextBody += " INSERT INTO ADV4SQL.dbo.ADVActivities"
An_SP.TextBody += " ("
An_SP.TextBody += " AcUserFK,"
An_SP.TextBody += " AcMachineFK,"
An_SP.TextBody += " AcDate,"
An_SP.TextBody += " AcActivity,"
An_SP.TextBody += " AcTableAffected,"
An_SP.TextBody += " AcRowAffected"
An_SP.TextBody += " )"
An_SP.TextBody += " VALUES"
An_SP.TextBody += " ("
An_SP.TextBody += " @UserFK,"
An_SP.TextBody += " @MachineFK,"
An_SP.TextBody += " @ActivityDate,"
An_SP.TextBody += " @Activity,"
An_SP.TextBody += " @TableAffected,"
An_SP.TextBody += " @RowAffected"
An_SP.TextBody += " )"
An_SP.TextBody += " SET @NewPK = SCOPE_IDENTITY() "
An_SP.TextBody += " END"
An_SP.Create()
End Sub
modified on Sunday, May 17, 2009 3:48 PM
|
|
|
|
|
RESOLVED !!
Thanks for your help. With a little more research, I was able to find and solve the problem. I found the error in the "InnerException". The error was: "Invalid syntax near 'PROCEDURE'". So I rechecked the sample code and noticed that the sample code did not have "CREATE PROCEDURE" in the .TextBody property.
Answer:
The lines below (marked BAD LINES) are not needed in the TextBody property, since they are actually created programmatically by SMO when the stored procedure is created with:
Dim An_SP As New StoredProcedure(mMyDatabase, Name, "dbo") As well, the lines defining the parameters are not needed since the parameters are created programmatically by SMO with:
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@UserFK", DataType.Int)) BAD LINES:
An_SP.TextBody += "CREATE PROCEDURE InsertActivityRow"
An_SP.TextBody += " @UserFK int,"
An_SP.TextBody += " @MachineFK int,"
An_SP.TextBody += " @ActivityDate datetime,"
An_SP.TextBody += " @Activity int,"
An_SP.TextBody += " @TableAffected int,"
An_SP.TextBody += " @RowAffected int,"
An_SP.TextBody += " @NewPK int OUT"
An_SP.TextBody += " AS"
An_SP.TextBody += " BEGIN" and
An_SP.TextBody += " END"
|
|
|
|
|
Hi,
I´m looking for control like Corel Draw tool text editor or similar.
Do you know something like this ?
I´m using a Rich Text Box, but the font render is very diferent to font render of pdf library (iText),
( the RTB render text using GDI and iText render text using GDI+ )
I need write text, with any format ( font size, styles...), and then generate PDF document.
( what you see in screen must be identical in PDF )
somebody help me please
thanks!
|
|
|
|
|
Hi,
My requirement is my Windows application should check periodically for latest updates on some network or web location and users can download only changed files. I found ClickOnce is helpful for this but also I am not sure that it is designed for only sandbox execution/only for current user context or once downloaded, the application can be used by any user on that machine.
My application is going to be installed once on multiple machines on shared way so any user logs on should be able to run it.
How can I achieve this task?
Your ideas please.
Thanks.
|
|
|
|
|
hi
i need to split a string ATTATCGATGATATTATTGGTCTTATTTGT into each alphabet..
after splitting each index of the array should hold each alphabet eg. splitseq (0) = A, splitseq(1) = T n so on till the end of the sequence..
FYI its a gene sequence
pls reply urgently.....!!!!
|
|
|
|
|
So you're splitting it into a char array? There's a big hint in that sentence.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Don't cross-post. The daily CCC should be posted in the Lounge only.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi poojapande;
You can use the ToCharArray method of the string class as shown in the code snippet.
Dim geneSeq As String = "ATTATCGATGATATTATTGGTCTTATTTGT"
Dim splitseq() As Char
splitseq = geneSeq.ToCharArray()
' Display the splitseq array
For Each ch As Char In splitseq
Console.WriteLine(ch)
Next
Fernando
|
|
|
|
|
Dear ALL,
How Can I Disable "Print" And "Save As" Options From a Sharepoint Server MOSS 2007 document library, so the users will be able only to view the document (Word, PDF,...) And no one will be able to Print Or Make a Save As for all the documents in this document library.
Regards,
|
|
|
|
|
I had installed the Intel fortran in my PC.
I had created the Test.F90 (fortran code)
SUBROUTINE GetNum (num, unit)
REAL*8 num,unit
unit = num+10
RETURN
END
I had created the c++ code in Microsft Visual studio 2005.
#include<iostream>
using namespace std;
extern "C"
{
__declspec(dllimport)
void _stdcall GetNum(double&,double&);
}
void main()
{
cout << "Hi MalliKARJUN" << endl;
double a,b;
a=10.0;
b=0.0;
GetNum(a,b);
}
I had added the fortan dependencis project with the above c++ project .
Above c++ project compile successfullly but it gives following errro while we build the code
error LNK2019: unresolved external symbol __imp__GetNum@8 referenced in function _main
Kindly help me out to resolve this issue
|
|
|
|
|
Hi,
I have the following warning when i build the setup project requiring 3.5 sp1.
Warning 1 Could not find prerequisite '.NET Framework 3.5 SP1' in path 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\'
I used instructions from http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#General%20Issues[^] to copy net 3.5 sp1 to bootstrapper and modify product.xml as necessary.
The modifications were
<PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001" />
<PackageFile Name="dotNetFX30\XPSEPSC-amd64-en-US.exe" PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001" />
and added right after <PackageFiles CopyAllPackageFiles="IfNotHomeSite">
< PackageFile Name="TOOLS\clwireg.exe" />
< PackageFile Name="TOOLS\clwireg_x64.exe" />
< PackageFile Name="TOOLS\clwireg_ia64.exe" />
However i get that warning and i am unable to add net 3.5 sp1 to setup project. The solutions i found were to check again product.xml file and it's ok, restart, clean solution rebuild. Didn't work. Do you have some other suggestions?
Thank you
P.S. I hope this is the correct thread
|
|
|
|
|
Hi,
I have the following warning when i build the setup project requiring 3.5 sp1.
Warning 1 Could not find prerequisite '.NET Framework 3.5 SP1' in path 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\'
I used instructions from http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#General%20Issues[^] to copy net 3.5 sp1 to bootstrapper and modify product.xml as necessary.
However i get that warning and i am unable to add net 3.5 sp1 to setup project. The solutions i found were to check again product.xml file and it's ok, restart, clean solution rebuild. Didn't work. Do you have some other suggestions?
Thank you
P.S. Deleted modifications to product.xml for a better view of post
|
|
|
|
|
Solved. In file product.xml i added
<PackageFile Name="TOOLS\clwireg.exe"/>
<PackageFile Name="TOOLS\clwireg_x64.exe"/>
<PackageFile Name="TOOLS\clwireg_ia64.exe"/>
which had a space before PackageFile which had to be removed for all 3 entries
|
|
|
|
|
I want to import contacts from windows address book in c# or vb.net. can anyone help me with that.
|
|
|
|
|
Hello!
I want to Delete Record from Data Grid if Check Box is checked, its a windows mobile application.
please help me.
Thanks.
sssssssss
|
|
|
|
|
the form has a field of MainMenu.
help me, how to paint the mainMenu, please.
|
|
|
|
|