Netcode 33 Veteran Poster

Use the PrintDcoument class or

Netcode 33 Veteran Poster
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     
    My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValueApplication.ProductName, Application.ExecutablePath)
     
    End Sub
Netcode 33 Veteran Poster

From your attached, it shows that the application cannot find the specified file. Make sure you point to the exact directory of the text file

Netcode 33 Veteran Poster

Hi Everyone
I want every single operation carried out on my application from signing in to signing out written to a text file and the operations would have a timestamp for each corresponding operation. How do i go about this, i have no single idea at all.

Thanks

Netcode 33 Veteran Poster

you need to read up on this. First, get an FTP client application and log in to your domain on the host provider and FTP the site.

This link may help:www.asp.net/hosting/tutorials/determining-what-files-need-to-be-deployed-vb

Netcode 33 Veteran Poster

Thanks you guys. Already solved it. My codes were very okay just that i forgot to add codes to bind my controls to the dataset.

Netcode 33 Veteran Poster

You could always change your code to be:

Catch ex As Exception
MsgBox(ex.Message)
Finally

to actually see what exception is being caught.

The Structured error sysntax is very okay. I just need the codes to return selected dataset using the connection string in the class

Netcode 33 Veteran Poster

I have written the following code in a class as my connection string. I want to retrive data from a field in a table in my database using this connecyion string. Please how do i go about it?

Public Class ConnectionString
    
    Public Shared Function ConnSQL() As SqlConnection
        Dim connectionString As String
        Dim cnn As SqlConnection
        connectionString = " initial catalog=dbase; Data Source=localhost; User Id=user; Password=pass"
        cnn = New SqlConnection(connectionString)
        Try
            cnn.Open()

        Catch ex As Exception
            MsgBox("Cannot open connection ! ")
        Finally
            cnn.Close()
        End Try
        Return cnn
    End Function

End Class
Netcode 33 Veteran Poster

already did that and it worked. thanks

Netcode 33 Veteran Poster

Hello everyone!
I want to write my connection strings and functions in a class and always call the class when i need to make a connection to my database to avoid code repetition and increase code reuse but i have an error. Here is my code below

Public Class ConnectionString

    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Public Shared Function ConnSQL() As SqlConnection
        Dim connectionString As String
        Dim cnn As SqlConnection
        connectionString = "localhost;Initial Catalog=MSS;User ID=;Password="
        cnn = New SqlConnection(connectionString)
        Try
            cnn.Open()
            Return cnn
        Catch ex As Exception
            MsgBox("Can not open connection ! ")
        Finally
            cnn.Close()
        End Try

    End Function

The end function is underlined and states this: Function Sqlconn does not return a null value on all code paths

Netcode 33 Veteran Poster

Is it a web application (FileUploadControl to be used) or a windows application

>add a new column to the table to save the image
> use the binary data type for the image column in SQL-Server
>In your code, convert the image in the control to binary
> save to your database

Netcode 33 Veteran Poster

first of all, to have a matching 'user_id' with a matching 'iD' in the users table, there has to be a relationship between the two tables in order to avoid conflicts or avoid the return of nulls.

Netcode 33 Veteran Poster

if its on the fly, you should give preferences to the text-boxes so that there wont any error in the calculation(by skipping a text-box) or better still, you can just code a button to help do the summation.

Netcode 33 Veteran Poster

this worked. Thanks guys

Netcode 33 Veteran Poster

I want to use the ASPNETDB.mdf created by the login control in the project directory. This is my connectionstring:

<connectionStrings>
    <add name="ApplicationServices"
         
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
Netcode 33 Veteran Poster

Hello Everyone!
Am working on a project and its ready for the production server. I used the windows login controls and ASPNET.mdf as the default database. I have moved the folder containing the project to the production server and deployed it on IIS but when a uer tries to access a page and is redirected to the login screen, it give the following error:

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

Please i need help with this

Thanks

Netcode 33 Veteran Poster

Solved. Thanks everyone

Netcode 33 Veteran Poster

thanks sandee, but it returned no record. I really don't know where am getting it wrong.I've done this multiple time before but cant figure out why this is different

Netcode 33 Veteran Poster

solved, i had to install asp.net from the directory.

Netcode 33 Veteran Poster

i tried changing the '+' to '&' and got the same error but when i used the line break (vbcrlf), i returned the page without errors but i got no record which is not possible cos i have records that match the search

Netcode 33 Veteran Poster

Still the same error

Netcode 33 Veteran Poster

Hello everyone!
Am trying to retrieve data from sql server based on two columns. Its a web application being developed using VS2010 (vb.net) but i keep getting the error: incorrect syntax near '='
Here's my code below:

Sub GetBasicMidwives()

        ' Set the SelectCommand properties...
        With objDataAdapter
            .SelectCommand = New SqlCommand()
            .SelectCommand.Connection = objConnection
            .SelectCommand.CommandText = "SELECT Reference_Number, Year, Title, Surname," + _
                "FirstName, Date_of_Birth, Origin, Phone, State_Deployed, Facility_Deployed FROM HEALTHWORKERS" + _
                "WHERE DESIGNATION = BASIC MIDWIVES"


            .SelectCommand.CommandType = CommandType.Text
        End With

        ' Open the database connection...
        objConnection.Open()
        ' Fill the DataSet object with data...
        objDataAdapter.Fill(objDataSet, "HEALTHWORKERS")
        ' Close the database connection...
        objConnection.Close()
        ' Set the DataGridView properties to bind it to our data...

        With BMGridView

            .AutoGenerateColumns = True
            .DataSource = objDataSet
            .DataMember = "HEALTHWORKERS"
            .DataBind()

        End With

        RecordCountLabel.Text = BMGridView.Rows.Count & " " & "Record(s)"

        'clear memory
        objDataAdapter = Nothing
        objConnection = Nothing

    End Sub
Netcode 33 Veteran Poster

i think you should reintall the server 2008

vishalrane commented: i was having 2008 because of which problem arised... -1
Netcode 33 Veteran Poster

all these have been tried, none seems to be working. I dont know if there's a problem somewhere

Netcode 33 Veteran Poster

Yousuf, how many time do i have to show my code? well, here it is:

Textbox1.text = DropDownList.text.tostring
Netcode 33 Veteran Poster

Thanks Crishlay, but ma not doing that in a page_load event. Its in the selectedindexChanged event of the dropdown control and it does not work. i really dont know whats wrong.

Netcode 33 Veteran Poster

Hi pgmer, i've tried that before and it shows nothing on the textbox. Am actually not a newbie so am also surprised that did not work. Its actually the VS2010 Professional so am wondering if there's any change in the process. Please help

Netcode 33 Veteran Poster

Hello everyone,
Please am working on a project basically for storing personal data for some employees. I have a dropdownlistbox which gets its content from a table in SQL-Server. I also have a textbox which i want its text to be the same with the selectedted item of the dropdownlist but it seems not to be working

Here's my simple code which was inplemented in the dropdownlistbox_Selectedindexchanged Procedure:

TextBox1.Text = DropdownListBox1.SelectedItem.ToString
Netcode 33 Veteran Poster

You need to create a virtual directory in IIS and then configure its directory to the location of your application or better still, you can just add application and give a name to the site as it would be seen by user and then locate the file path to your application.

Happy programming!

Netcode 33 Veteran Poster

I dont understand whta you mean by IIS options. Are you talking of the application pool?

Netcode 33 Veteran Poster

Hello everyone!
Please am developing a web application using vb.net with visual studio 2010 and .NET framework 4.0. its complete but i want it accessible over the network (LAN) so i have tried to host it on the local server (IIS) but i keep getting the following error message from IIS:

HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list


Please i need urgent help

Netcode 33 Veteran Poster

I mean moving from one tab page to another on a tab control by simply clicking on a button

Netcode 33 Veteran Poster

How do i move from one tab page to another with a single button click?

Netcode 33 Veteran Poster

you can simply set the ID column as a primary key in the DBMS

Netcode 33 Veteran Poster

Good, at least it now shows the MDI Parent form. To stop the application from running when you close the MDI Parent form, do this:
1. Double click on the MDI form
2. Go to the Form_Closed Procedure
3. Type in the word 'End'

Netcode 33 Veteran Poster

Thanks luc001. i guess it was a typo. hope it solves Yousha's problem

Netcode 33 Veteran Poster
display all running programs ()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'displays the current system processes.
        Dim myquery = From anitem In Process.GetProcesses _
                Select anitem.ProcessName, anitem.Threads.Count, anitem.Responding
        DataGridView1.DataSource = myquery.ToList
    End Sub
Netcode 33 Veteran Poster

Follow these steps:
1. Set the Startup Form property of the project to your login form
2. Set Shutdown mode property of the project to 'when last form closes'

On your login form
'enter your codes to check username and password
'on successful login

MdiParent.show
loginform. Dispose
Netcode 33 Veteran Poster
Private Sub New_User_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'declare variables
      Dim randomvalue As New Random   'create random object
      Dim randomhold As Integer
  
   'generate random number
            For i As Integer = 0 To 9999
                randomhold = randomvalue.Next(1, 9999) + DateTime.Now.Minute +                  DateTime.Now.Year
                txtUserId.Text = randomhold
            Next
End Sub
Netcode 33 Veteran Poster

I have a datagridview control on my form. i use this to display data including images. Please how can i set the row height of the datagridview control so the picture can be well displayed?

Thanks

Netcode 33 Veteran Poster

set your login form as the startup form from the project properties. and set the project to close when last form closes so the project does not terminate when startup form (login) closes here is the code for displaying the MDIparent form:

'enter code to check username and password here
'if entry is authorised

loginform.dispose 
Mdiparent.show
Netcode 33 Veteran Poster

why do you have a datetimepicker and a textbox? you can just use the value or text property of the datetimepicker.

Netcode 33 Veteran Poster

Please how do i create a report at runtime in vb.net? I have no idea at all because i've never worked with crystal reports and most tutorials I've come across actually don't treat the topic.

Netcode 33 Veteran Poster

Fortinbra, thanks but i dont believe in changing OS as it does not depict increase in knowledge.
Adatapost, thanks but i already found a solution. My system was running windows update so it was actually in use and could not be reached.

Netcode 33 Veteran Poster

Hi guys!
I just installed a new windows vista on my newly bough hard drive. i tried to deploy my web application to the local IIS server but the default web site appears to be stopped which prevents any site from being accessible over the LAN and when i try to start the process it throws his error: "The process cannot access the file because it is being used by another process.(Exception from HRESULT:0x80070020)"
Please what could be the problem?

Netcode 33 Veteran Poster

sandeepparekh9, thanks. thats what i do but its not professional. An application should normally install a shortcut on the users desktop

Netcode 33 Veteran Poster

Please how do i do this? The sql server database already exists on the system but it cannot access it.

Netcode 33 Veteran Poster

Follow these steps:

1. Place a RegularExpressionValidator on your form
2. Set the controlToValidate property to the control you want to validate
3. Click on the elipsis button on the validationExpresion property of the control
4. Select internet email address from the list of standard expressions

Netcode 33 Veteran Poster

Hello All! Please i designed a website and hosted it. The problem is, it displays the custom error page whenever i try to view the registration page which is meant for data entry.
What could be the possible error because it works perfectly when tested on the LAN

Netcode 33 Veteran Poster

does not work