|
hi good day to all!
Can someone help me share some code in vb6 with regards to printer character code such as print#, chr(27) & "@" to initialize the printer. When done printing i tried chr(12) and still the passbook printer status after feed off paper, any character code use to deselect or off the printer?
Thanks!
|
|
|
|
|
Hi All
I'm trying to do a mailmerge from a VB.NET winform program into an MS Word Document but I am getting tied up in knots right at the start.
Visual Studio 2005
I have added the MS Office Word reference to the Solution
Imports Microsoft.Office.Interop.Word
Form_Open
Dim oWordApp As New Microsoft.Office.Interop.Word.Application
oWordApp.Visible = true
the oWordApp is underlined as a error of "Declaration Expected"
All help & Pointers Gratefully received
|
|
|
|
|
can anyone tell me if there is a dll in vb.net which has the implementation of all the functions used in ms excel.
I want to use these functions in my application
thanks in advance...
|
|
|
|
|
Not unless you count Excel. You can control Excel using the Microsoft tools for office, but your users will need Excel installed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I want to use these functions in datagrid.
|
|
|
|
|
Well, that's just too bad. Really, you can't. Why would someone write a free dll that turns a datagrid into Excel ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem.
I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to).
Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated.
Thanks.
|
|
|
|
|
I'd deploy a different app.config, or perhaps write code so that the debug version of your code reads one setting and the release, reads another. You do this with
#ifdef DEBUG
#else
#endif
in C#, I am not sure if VB is capable of that tho.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Couple of solutions:
1. Use two different connections settings, ex: devConnectionString and ProdConnectionString
2. Make a form that allows user to input settings such as db server name etc and save those settings.
|
|
|
|
|
You can consider something like this (change DEV_COMPUTER and TEST_COMPUTER to match the names of your computers):
<appSettings>
<add key="ConnectionString_DEV_COMPUTER" value="..." />
<add key="ConnectionString_TEST_COMPUTER" value="..." />
</appSettings>
ConfigurationManager.AppSettings("ConnectionString_" + Environment.MachineName).ToString
|
|
|
|
|
We allow the user to select the target server from a list when they logon. This then supports Dev/UAT/Production. Some of our apps will also have multiple scenario copies the user may need to use.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Good Morning All,
I have a question that I'm hoping someone out there maybe able to help me with. I'm trying to bind a CheckListBox to an Excel spreadsheet that has two columns of data. IPAddress & SystemName. I am new to programming and have only been able to get this fare. If anyone could help, you have my sincere thanks.
Tazy
Private m_sConn2 As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source='C:\IPMonitoringTable.xls';Extended Properties=Excel 8.0"
Public Sub Retrieve_Records()
Dim conn As New OleDbConnection(m_sConn2)
Dim ExcelData As String
Dim i As Integer
conn.Open()
Dim da As New OleDbDataAdapter("Select IPAddress, SystemName, SysDate, SysTime, UserID from [IpAddrMonitor$]", conn)
Dim ds As DataSet = New DataSet
Try
da.Fill(ds)
CheckedListBox1.DataSource = ds
CheckedListBox1.DisplayMember = ds.Tables(0).TableName
'MsgBox(CheckedListBox1.Items(0).ToString) 'This didn't work
'MsgBox(CheckedListBox1.Items.Item(i).ToString()) 'Nor This
Me.Refresh()
Catch OleDbExceptionErr As OleDbException
MsgBox(OleDbExceptionErr.Message)
End Try
conn.Close()
|
|
|
|
|
Tazy wrote: I am new to programming
Then why are you working on something this complex ? No-one is paying for your 'new to programming' code, are they ? If so, shame on you. If you're learning, choose something simpler to start with. You're just guessing here, and you'd do better to take a methodical approach to learning.
Tazy wrote: 'MsgBox(CheckedListBox1.Items(0).ToString) 'This didn't work
'MsgBox(CheckedListBox1.Items.Item(i).ToString()) 'Nor This
Well, a MsgBox is the wrong approach to take with ASP.NET anyhow, that will kill your server in a hurry. However, I assume this is debug code. Try instead to set a breakpoint. You'll find that the item is actually a DataRow, so you need to do Items(0)("SystemName"), or whatever.
In futurem don't say 'this didn't work', say 'this threw this excpetion', or 'this gave me a different result to what i hoped for, as follows... ', or 'this gave me the following compiler error.
And, for the love of all that is holy, buy a book and refer to it before asking questions. That's another step towards learning, towards actually becoming a programmer. People who take those sort of steps, are the sort of people we most like to help, because it doesn't feel like smashing your head against a wall.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No I'm new on the job and just grad. from school and this is part of a project my boss has asked me to take over. I thought this would be easier then this and would make me look good, but school has prepared me enough for this type of project. But I also don't like to give up, so I keep trying. I don't want him to think that he hired the wrong person for the job.
|
|
|
|
|
OK - well, like I said, when you get an item from the items collection, it's a datarow, so you need to look up the data in the column you want to view from there. That's what the control does with the displaymember property.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
One error I spotted
Tazy wrote: CheckedListBox1.DisplayMember = ds.Tables(0).TableName
should be something like
CheckedListBox1.DisplayMember = "SystemName" (or whichever column you want to display)
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Good Morning Bob,
And once again Thx for your assistance. I tried your response will was given only:
"System.Data.DataViewManagerListItemTypeDescriptor" when running my program. Is there anything else I could try?
|
|
|
|
|
This is further proof that my answer is correct. Did you try what I suggested ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry, didn't read the code fully.
Christian's reply is correct.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Is it possible to connect to any webserver through socket and receive the data using Socket?
Actually, I am developing one program which sends query to Google.com through socket and reads and dumps all the search results in a text file.
The parameters I have used in my program:
Dim client As New TcpClient("google.com", 80)
Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes("search?q=codeproject")
Dim stream As NetworkStream = client.GetStream()
stream.Write(data, 0, data.Length)
' then read response and do stuffs
But I'm getting error like:
SocketException: System.Net.Sockets.SocketException: No connection could be made
because the target machine actively refused it
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
Any idea why I'm getting this error?
"hi, I am explorer.exe. sometimes when you are doing anything at all, I will just freeze for ten minutes. All of my brother and sister windows will also freeze, because they are sad for me. Maybe we will come back, maybe not, it will be a surprise!"
|
|
|
|
|
Because you cannot. Use the httprequest and httpresponse classes instead.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks CG. Its working with httprequest.
"hi, I am explorer.exe. sometimes when you are doing anything at all, I will just freeze for ten minutes. All of my brother and sister windows will also freeze, because they are sad for me. Maybe we will come back, maybe not, it will be a surprise!"
|
|
|
|
|
hello all,
I'm a Asp.net developer and i know how to deploy a asp.net site with sql server database.
in asp.net website we just link with Remote server and deploy our database on that server.
but my question here is that while creating a window application in c# or vb if we have a database in sqlserver how we will deploy the sql sever database on every client machine individually.
is there any option in setup and deployment wizard. or we there is any other way.
Regards
Amit Agarwal
|
|
|
|
|
You wouldn't normally deploy sql server with an application, you normally have sql server running on a dedicated windows server on the network and clients connect to it, otherwise you have no single database for the company - each user has their won database, which doesn't make sense.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
There's no option. People generally deploy an Access DB if they can. Otherwise you need to deploy SQL Server Express, and code to create the database within it. This is a fair bit of work.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|