|
1) Which account are you referring to ?
2) yes I'm domain and local admin so there should not be a problem there
|
|
|
|
|
Hi All,
Iam writting a console application where user writes in command prompt the following:
ApplicationName.exe "PathOfFile" "PrinterName"
to print a ceratin file.
My issue is that if i chosed a printer that is not set as default on my pc it is not printing.
In other words, i need a command that sets a certain printer on the network to be as my default printer in order to let my application prints the file.
i dont want the user to manully sets the targeted printer as default. I want a script/batch that sets that printer as default and then prints from my application.
Any Ideassss.....
|
|
|
|
|
samerh wrote: dont want the user to manully sets the targeted printer as default. I want a script/batch that sets that printer as default and then prints from my application.
So, you want the user to set the default printer back to what it was after your code runs?
samerh wrote: Iam writting a console application where user writes in command prompt the following:
ApplicationName.exe "PathOfFile" "PrinterName"
Why is the user specifying a printer name if your code doesn't use it? Your code has to be written to use this and not depend on the default printer. There is no single command that's going to fix this problem for you.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
we have written code to start the 'HH.exe' process with argument passed. And the process is started.
After starting this we are calling MainWindowHandle.ToInt64 of the above process. But am getting 'Process has Exited, so the requested information is not available'. When i check in task manager, the 'HH.exe' is running
Can any one tell me what could be the cause the above issue and solution for it
Thanks
R.Vasanth
|
|
|
|
|
If this "HH.EXE" is a DOS application, there will be no MainWindowHandle.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
I switched over from VB6 to VB.NET.
In VB6 when we wanted to temprorily disable error handling, we used "Break on all Errors".
How do we disable error handling in VB.NET?
I've Got stuck in a procedure that has a lot of code between the try...catch block and many nested try.. catch blocks too. I want to know which part of the code is generating errors.
Please help.
Thanks,
|
|
|
|
|
Do the errors not throw exceptions? If they do have you tried checking the stack trace for the error? That should at least point you in the right direction.
|
|
|
|
|
There is no equivilent in VB.NET.
Set breakpoints in your catch statements and look at the stack trace,
or set them at the beginning of your Try blocks and step through the code line by line,
or comment out the Try/Catch statements,
or instrument your code and log critical information you need to trace back the errors.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
You said you want to know what part of the code is generating errors. It sounds to me like you actually want the errors to happen as though there is no try...catch block. You can accomplish this by going to Debug > Exceptions and then checking the checkbox for 'common language runtime exceptions' under the 'thrown' column. This should cause the program to break when an error occurs even if it's in the try...catch block.
|
|
|
|
|
Hello,
I am working in Visual Studio.NET 2003. I just want to ask if there is any way I could tell System.Diagnosis.Process to start a new process/window on my desired location. Actually I am working in a Multiple Monitor environment and want System.Diagnosis.Process to open on the second monitor (by setting up location)
<br />
Dim p As System.Diagnostics.Process<br />
Dim pinfo As New System.Diagnostics.ProcessStartInfo<br />
pinfo.Arguments = "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\Picture 001.jpg"<br />
pinfo.FileName = "C:\windows\system32\rundll32.exe"<br />
Process.Start(pinfo)<br />
Above is a code which i am using to open up Windows Picture and Fax viewer(of which i want to set the location of)
Thanks,
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
You can't tell it which monitor to start on. An application will always show up on the primary monitor, then you move it to the monitor you want. The exception to this is if the application was run before and it saved it's last position, before it closed, so that it can recreate it's window in that same position the next time it runs.
So, you're only choice is to launch the application, get it's window handle, by calling the Win32 API function FindWindow, then sending the appropriate window messages to that handle to move it to the desktop coordinates on the next monitor.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
i want to copy a line from any text file and paste it to another text file.
let me know how to do that?
regards
pankaj kumar
|
|
|
|
|
Which bit are you stuck on ? You can't insert text into a file, you need to read it, insert it in memory, and overwrite the existing file.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
basically i need to check a checkbox on an access database to therefore block the user from using that account. my code is wrong(below) plus the catch exception is brining up this message "No value given for one or more required parametres"
i think this line of code could be the problem because i keep on getting warningsm on it :- If dr.Read() Then 'if the entry is correct (readable)
can anyone recterfy my code please?
Imports System.Data.OleDb
Public Class Block
Public conn As OleDbConnection
Public comm As OleDbCommand
Public dr As OleDbDataReader
Public da As OleDbDataAdapter
Dim icount As Integer
Private Sub Btnblock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlock.Click
'when the logon button is pressed
Dim ManagerLogin As String
'declares the variable
Try
conn = New OleDbConnection 'establishes that conn is a new connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\PCBank.mdb" 'the name of the connection (name of the database on the end)
conn.Open() 'opens the connection
comm = New OleDbCommand 'establishes that comm is a new command
comm.Connection = conn 'the connection for the command is the connection specified
comm.CommandType = CommandType.Text 'the commands are in text
ManagerLogin = "SELECT DISTINCT Password FROM Accounts WHERE ManagerID='" & Me.tbID.Text & "' "
'the variables value is an SQL command, selects value that is equal to the id AND password.
''MessageBox.Show(ManagerLogin) 'shows the sql command (only needed for testing)
comm.CommandText = ManagerLogin 'the variable is declared as a command
dr = comm.ExecuteReader 'gives the variable a value
conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=PCBank.mdb")
conn.Open()
comm = New OleDbCommand("insert into Accounts(Blocked) values('" & (chBlock.CheckState) & "')", conn)
icount = comm.ExecuteNonQuery()
MsgBox("record inserted")
chBlock.Checked = False
Catch ex As Exception
MsgBox(ex.Message)
If dr.Read() Then 'if the entry is correct (readable)
Me.Close()
Form2.Show() 'show the index varibale (form)
'close the current form
Else 'if the entry is incorrect
MessageBox.Show("Invalid ID, please try again") 'displays error message
tbID.Clear() 'clears the managerid
End If 'end if
End Try
conn.Close()
End Sub
End Class
|
|
|
|
|
I'm not sure, but it looks like you're inserting a new record into a table called Accounts. Shouldn't this be an UPDATE statement that changes as field in the record in question?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
We had developed a project using asp.net with vb script. Dash Board solutions. it is to update the data in our department and to keep track of date and work. It had different logins for each user and different kind of permission for differet kind user viz manager, leader, associate. A brief description is given,
Introduction:
The project is a complete project monitoring and scheduling system that coordinates the activities of our offshore hydraulics research center located at Bangalore. As many as 50 users may be using this system at any given time. The objective was to develop a secure, single window, loading and scheduling system, which has the following features.
Efficiently coordinate a hierarchy of team members comprising of Administrators, Managers, Leaders and Associates.
Simplify the loading and scheduling process, together with effectively managing task types and material specifications for the resources used in the project.
Streamline workflow and inculcate effective delegation of responsibilities within the team hierarchy.
All or individual stages of the project may be assigned/resigned to various team leads in various time frames. Therefore a means to tracking document history was incorporated into the system.
A messaging system keeps the managers and leads well informed about the current status of the project, thus minimizing possible stumbling blocks and increasing the clarity of the big picture.
As progress is made on each project, associate/ team leader feedback is used to calculate plausible cycle times and scheduling sequences that would be optimum for current and future projects.
All of these steps were instrumental in ensuring maximum productivity, smoother transition from the analysis to the development stage, which in turn ensured a faster time-to-market and ROI for our offshore research centers.
Tools and Technologies : VB.NET, ASP.NET, SQL Server, Crystal Report
Domain : Project Monitoring
The products to which project will be taken are broadly divided into two categories viz.,
1. Cylinders
2. Truck hydraulic
The user of this project will be one among the following.
1. Administrator
2. Manager
3. Project leader
4. Project associate
5. Marketing Executive
the project has developed in .net 2002. Now we have installed .net 2005. The users wanted some changes and i did those changes and copied those files from my local system to server. but when we go for url (http:\\wielweb\dbs) i am getting the following error. what could be the reason for the error?
Server Error in '/dbs' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The 'CodeFile' attribute is not supported by the 'page' directive.
Source Error:
Line 1: <%@ Page Language="vb" AutoEventWireup="false" Inherits="Dash_Board.WebForm1" CodeFile="Login.aspx.vb" %>
Line 2:
Line 3:
Source File: D:\Deljo\DBS\Login.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
Chaitra N
|
|
|
|
|
I could be wrong but I believe the CodeFile attribute is for .Net 2.0 not 1.1
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
If it is so, what is the change i have to make, Here is the code of login.aspx.vb file,
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Dash_Board.WebForm1" CodeFile="Login.aspx.vb" %>
<title>Dash Board Solution
<asp:label id="Label1" runat="server" text="Login Name :" forecolor="SaddleBrown" width="136px" font-names="Vrinda" font-size="Large">Login Name :
|
<asp:textbox id="txtlogin" runat="server" forecolor="SaddleBrown" width="134">
| <asp:label id="lblmsg" runat="server" forecolor="Red" text="Incorrect Login !" visible="False">
|
<asp:label id="Label2" runat="server" text="Password :" forecolor="SaddleBrown" width="114px" font-names="Vrinda" font-size="Large">Password : | <asp:textbox id="txtpassword" runat="server" forecolor="SaddleBrown" width="134" textmode="Password"> | | <asp:button id="btnlogin" runat="server" text="LOGIN" forecolor="SaddleBrown" width="76px">
|
| |
Chaitra N
|
|
|
|
|
If it is so, what changes i need to do to make it work properly. Here is the code of "login.aspx" file
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Dash_Board.WebForm1" CodeFile="Login.aspx.vb" %>
<title>Dash Board Solution
<asp:label id="Label1" runat="server" text="Login Name :" forecolor="SaddleBrown" width="136px" font-names="Vrinda" font-size="Large">Login Name : |
<asp:textbox id="txtlogin" runat="server" forecolor="SaddleBrown" width="134">
| <asp:label id="lblmsg" runat="server" forecolor="Red" text="Incorrect Login !" visible="False"> |
<asp:label id="Label2" runat="server" text="Password :" forecolor="SaddleBrown" width="114px" font-names="Vrinda" font-size="Large">Password : | <asp:textbox id="txtpassword" runat="server" forecolor="SaddleBrown" width="134" textmode="Password"> | | <asp:button id="btnlogin" runat="server" text="LOGIN" forecolor="SaddleBrown" width="76px">
|
| |
Chaitra N
|
|
|
|
|
I created a VB.Net library which I hope to use in VB6.0 I issues this command regasm test.dll /tlb: test.tlb but unfortunatly I could not reference any of the public properties. Plz I need help for urgent solution.
What worths doing should be done well
|
|
|
|
|
Did you create a COM dll in VB.NET, and if not, how did you hope for this to work ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
how do i find a record in a multi column table data view in vb.net and how can i move in that view....like move next, move previous etc. as it could be done in the recordset of vb
|
|
|
|
|
Hi Anz,
Check it
http://www.codeproject.com/vb/net/SQLEditor.asp[^]
It can Help u
See in article
'If the table contains a primary key, use that to find the record.
For i As Integer = dca.GetLowerBound(0) To dca.GetUpperBound(0)
dv.RowFilter = "COLUMN_NAME = '" & dca(i).ColumnName & "'"
sSQLDataType = dv(0)("TYPE_NAME").ToString()
If sSQLDataType.Equals("text") Or _
sSQLDataType.Equals("ntext") Or _
sSQLDataType.Equals("image") Then
sTmp = "[" + dca(i).ColumnName + "] LIKE @" + _
RemoveIllegalChars(dca(i).ColumnName, _
m_RemoveChars)
Else
sTmp = "[" + dca(i).ColumnName + "] = @" + _
RemoveIllegalChars(dca(i).ColumnName, _
m_RemoveChars)
End If
If dca.GetLength(0) > 1 Then
sSQL = sSQL + "(" + sTmp + ")"
Else
sSQL = sSQL + sTmp
End If
If i <> dca.GetUpperBound(0) Then sSQL = sSQL + " AND "
Next
Pankaj Jain
|
|
|
|
|
i want to show tiff in image edit and also zoom and scroll the image
sathish
|
|
|
|
|
Are you going to write this "image edit control" or are you going to use a third party control?
The .NET Framework doesn't come with a packaged control that does this.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|