Kshiteesh 0 Newbie Poster

Dear frens...

I designed a software.....It is Address management information system. I have linked the database with report. But i have certain problem in report.

I want tabs in my report such as name, surname etc to be auto incrementing and auto decrementing and when the value is not passed to them hiding...

Like if the name is Shankar Dayal Sharma its ok
but when the name is just Shankar Sharma in report it appears as Shanakar Sharma
I want to fill in the gaps.

I hope u r getting it.and i also want to fill in the line when it does not contain any value. and appear when it has value.

In general terms. i want to autoincrement and autodecrement the gaps and auto hide and autoshow the lines.

How can i do it.

Please help with the queries .....and syntax.....and codes

I will be very grateful to you.

Anticipating ur help

Kshiteesh

Kshiteesh 0 Newbie Poster

You need to get reference of ado.net. then only that will work or support.

Just go to add reference in the menu bar and double click ado.net. you will get the problem solved..

Regards

Kshiteesh

Kshiteesh 0 Newbie Poster

I want to display it according to my designof report in the reportview. So please tell me how can I dynamically frame the query at runtime??

thanks n anticipating...

regards
Kshiteesh

Kshiteesh 0 Newbie Poster

Dear Frens,

I m beginner in VB.net.

I have developed an Address Management System where I want to add my searched grid into Crystal Report.
Unfortunately, I don't know code to make report from datagrid. or certain data set. I have succeeded in making report from primary dataset from crystal report by designining manually.

So, please help me make report from data grid searched . I would be very grateful if u help me.

my code for datagrid is as follows;

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Db1DataSet1.Clear()
        Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
        Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
        Dim S As String
        Dim datagrid1 As New DataGrid
        S = "select * from add1 where lname='" & TextBox1.Text & "'"
        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
        da.Fill(Db1DataSet1, "add1")
        datagrid1.DataSource = Db1DataSet1.DefaultViewManager

    End Sub

I want to add following data grid into crystal report viewer. but I don't know the code

Please help

Anticipating the help

Sincerly

Kshiteesh

Kshiteesh 0 Newbie Poster

I did as you said...but I still have problem in choosing the files in the third step..There comes a dialog box asking to add files. Which files should I add to it. Should I add my exe file or all the source files to it.

Please suggest me.

Kshiteesh 0 Newbie Poster

Dear frens,

I have made an application in VB.net using Visual studio 8, with ms access as a backend.

I have crystal report installed in it. I have got a problem while connecting database to the crystal report. I have also got problem in designing part. Is there any solution for it.

And the other part is that I also tried to make a report viewer througn database report viewer. But it showed certain problem .It showed report of only one row at one time and the report cannot be exported to word file.

Is there any solution for it.

I m in immense trouble.

Please help me

Waiting .....

Kshiteesh

Kshiteesh 0 Newbie Poster

Dear Blackknight,

Your problem is genuine for any beginner. you can use the following to add new record through add button.

Dim con As New ADODB.Connection

        Dim tmp As New ADODB.Recordset
        Dim s As String

        con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
        con.Open()
        s = "select * from add1"
        tmp.Open(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
tmp.AddNew()
        tmp.Fields("ID").Value = T18.Text
        tmp.Fields("Salutation").Value = T1.Text
        tmp.Fields("Fname").Value = T2.Text
        tmp.Fields("Mname").Value = T3.Text
        tmp.Fields("Lname").Value = T4.Text
        tmp.Fields("Degree").Value = T5.Text
        tmp.Fields("Category").Value = T6.Text
        tmp.Fields("Position").Value = T17.Text
        tmp.Fields("Org").Value = T16.Text

tmp.Update()
        MsgBox("Record Saved")
        Exit Sub

To display data in data grid you have to drag datagridview dataset and databinding source from the tool box and connect it to a data base. you can then write following code in the search button to show the items in the datagrid from the access table.

Db1DataSet1.Clear()

the aforementioned search option is by first name you can change accordingly your field names creating different forms and creating the links of those forms in a single menu form. 

If any problem persists, ask me. 

Regards

Kshiteesh
        Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
        Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
        Dim S As String
        Dim datagrid1 As New DataGrid
        S = "select * from add1 where fname='" & TextBox1.Text & "'"
        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
        da.Fill(Db1DataSet1, "add1")
        datagrid1.DataSource = Db1DataSet1.DefaultViewManager
Kshiteesh 0 Newbie Poster

Steven,
u can use this code to add record to a database

Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click
dim con As New ADODB.Connection

        Dim tmp As New ADODB.Recordset
        Dim s As String

        con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
        con.Open()
        s = "select * from add1"
        tmp.Open(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
        tmp.Update()
        MsgBox("Record Saved")
Exit Sub
Kshiteesh 0 Newbie Poster

Thanks frens ,

:?:
I have a problem while designing a report in VB.net. I have to put different text fields in a format however the values have variable lengths.

I found trouble in managing the gaps between the fields. Is there any process or solution to make such that the values autoaccomodate the text boxes so that it looks like

[Salutation] [fname] [mname] [lname], [degree]
[Position]
[organisation]
[Street] [City] 
[State]
[Country]
Phone:[tel1] ,[tel2],[tel3]
Fax: [fax]
Email: [email]
URL: [url]

for example above format should show in report as;

Dr. Preetham Saroja, Phd(USA)
Executive Director
International Centre for Information Technology
16 Avenue Stree, Mery Land
12121WA, USA
Phone: 001923823283232, 0012832832382,001232323223
Fax: 00123237626322
Email: preetham.saroja@icit.org
URL: www.icit.org

But I have the difficulty , like when I design long name keeping in mind and use short name instead for eg: Ram instead of Gangottery. then
a problem exists the space between two field vaues broadens....

I m using VB.net version 8. I m using msaccess as backend.

Please help me and provide me with necessary code if there is any. I have got just a week left for the deadline of my project.

Anticipating your replies

Kshiteesh

Kshiteesh 0 Newbie Poster

Dear Frens,

I have made a simple project. I want to create an installation file so that I can install and use it as a Window Application. Please help me with the steps to create the installation file.

Anticipating your reply.

Kshiteesh

Kshiteesh 0 Newbie Poster

Thank you Hamrick

Kshiteesh 0 Newbie Poster

Dear Friends,

I have been working on a VB.net project on VB8 with ms access as backend.

While finding certain data by entering primary key in the form i.e. id i experienced a problem. While displaying the values which are null in the database like wise tel1 is null then it shows the values in the form up to it and does not show the values after it. When there is null or empty value then the dbnull exception is shown. my code has been given below:

Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click
 tmp.Delete()
        B2.Enabled = False
        B1.Enabled = True
        MsgBox("Record is deleted")
End Sub

Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click
    Dim s As String


    con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
    con.Open()

    s = "select * from add1 where ID='" & T18.Text & "'"
    tmp.Open(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
    If tmp.EOF = True And tmp.BOF = True Then
        MsgBox("No record available")
        T18.SelectAll()
        T18.Focus()
        tmp.Close()
        Exit Sub
    End If
    B2.Enabled = True
    T1.Text = tmp.Fields("Salutation").Value
    T1.Focus()

    T2.Text = tmp.Fields("Fname").Value
    T2.Focus()
    T3.Text = tmp.Fields("Mname").Value
    T3.Focus()
    T4.Text = tmp.Fields("Lname").Value
    T4.Focus()
    T5.Text = tmp.Fields("Degree").Value
    T5.Focus()
    T6.Text = tmp.Fields("Category").Value
    T6.Focus()
    T17.Text = tmp.Fields("Position").Value
    T17.Focus()
    T16.Text = tmp.Fields("Org").Value
    T16.Focus()
    T7.Text = tmp.Fields("Street").Value
    T7.Focus()
    T8.Text = tmp.Fields("City").Value
    T8.Focus()
    T9.Text = tmp.Fields("State").Value
    T9.Focus()
    Cmb1.Text = tmp.Fields("Country").Value
    Cmb1.Focus()
    T10.Text = tmp.Fields("Tel1").Value
    T10.Focus()
    T11.Text = tmp.Fields("Tel2").Value
    T11.Focus()
    T12.Text = tmp.Fields("Tel3").Value
    T12.Focus()
    T13.Text = tmp.Fields("Fax").Value
    T13.Focus()
    T14.Text = tmp.Fields("Email").Value
    T14.Focus()
    T15.Text = tmp.Fields("URL").Value
    T15.Focus()


    B1.Enabled = False
    B2.Enabled = True
End …
Kshiteesh 0 Newbie Poster

Ya. thanks Pretham. saroja

I did as u said. But I have a problem while designing a report. I have to put different text fields in a format however the values have variable lengths.

I found trouble in managing the gaps between the fields. Is there any process or solution to make such that the values autoaccomodate the text boxes so that it looks like

[Salutation] [fname] [mname] [lname], [degree]
[Position]
[organisation]
[Street] [City] 
[State]
[Country]
Phone:[tel1] ,[tel2],[tel3]
Fax: [fax]
Email: [email]
URL: [url]

for example above format should show in report as;

Dr. Preetham Saroja, Phd(USA)
Executive Director
International Centre for Information Technology
16 Avenue Stree, Mery Land
12121WA, USA
Phone: 001923823283232, 0012832832382,001232323223
Fax: 00123237626322
Email: preetham.saroja@icit.org
URL: www.icit.org

But I have the difficulty , like when I design long name keeping in mind and use short name instead for eg: Ram instead of Gangottery. then
a problem exists the space between two field vaues broadens....

I m using VB.net version 8. I m using msaccess as bacend.

Please help me and provide me with necessary code if there is any. I have got just a week left for the deadline of my project.

Anticipating your reply

Kshiteesh

Kshiteesh 0 Newbie Poster

Dear frens,

from your help I succeeded in creating data grid . Thank you for it.

Now i need to generate report from data grid.

my data grid code is as follows;

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Db1DataSet1.Clear()
        Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
        Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
        Dim S As String
        Dim datagrid1 As New DataGrid
        S = "select * from add1 where ID='" & TextBox1.Text & "'"
        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
        da.Fill(Db1DataSet1, "add1")
        datagrid1.DataSource = Db1DataSet1.DefaultViewManager
End Sub

Now I want to generate report from the data field available in data grid in the form :
(Salutation) (fname) (mname) (lname), (degree)
(Position)
(organisation)
(Street) (City)
(State)
(Country)
Phone:(tel1) ,(tel2),(tel3)
Fax: (fax)
Email: (email)
URL: (URL)
I want to make two columns in the report to show various contacts' addresses in the data grid into printable form by generating report.

I don have any idea to generate report as i have never done it .

Please provide me with help with necessary explanations.

Anticipating for your help

Regards;
Kshiteesh

Kshiteesh 0 Newbie Poster

I have inserted searching through passing parameter likewise. In search form there is only one textbox to pass the value. But there are three field names which are associated with that text box.

For example: I have searched by passing phone number
But there three field name tel1, tel2 and tel3 which which are called when the phone number is passed. my code is as follows. my frontend is vb.net and my backend is ms access.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Db1DataSet1.Clear()
    Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
    Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
    Dim S As String
    Dim datagrid1 As New DataGrid

    Dim tmp As New ADODB.Recordset
    tmp.Open("add1", conStr, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)

    If TextBox1.Text = tmp.Fields("tel1").Value Then
        S = "select * from add1 where tel1='" & TextBox1.Text & "'"
    ElseIf TextBox1.Text = tmp.Fields("tel2").Value Then
        S = "select * from add1 where tel2='" & TextBox1.Text & "'"
    ElseIf TextBox1.Text = tmp.Fields("tel3").Value Then
        S = "Select * from add1 where tel3='" & TextBox1.Text & "'"

    ElseIf Not (tmp.EOF = True And tmp.BOF = True) Then : MsgBox("no record found")
    End If
    Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
    da.Fill(Db1DataSet1, "add1")
    datagrid1.DataSource = Db1DataSet1.DefaultViewManager
End Sub

In this snippet I have faced one problem. It shows one build error at

OleDb.OleDbDataAdapter(S, con)

which says

Variable 'S' is used before it has been assigned a value. A null reference exception could result at runtime.   

And when I …

Kshiteesh 0 Newbie Poster

Thank you Veena ......

I found wot the mistake was......I put the load event code in click event.....

At last my problem is solved.....

Thanks again...

Kshiteesh

Kshiteesh 0 Newbie Poster

Dear frens and especially the ones who have helped me. Hi to all...

The code in form to show data in the data grid is as follows.

But when i tryto run it then it runs and when i click then it shows the InvalidOperationException was unhandled showing error msg.

{"The SelectCommand property has not been initialized before calling 'Fill'."}

how can i overcome this problem

Public Class name

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       [inlinecode] Dim oledbdataadapter1 As New OleDb.OleDbDataAdapter
        Db1DataSet1.Clear()
        oledbdataadapter1.Fill(Db1DataSet1)
    End Sub
    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub


    Private Sub name_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'Db1DataSet1.add1' table. You can move, or remove it, as needed.
        [inlinecode]Me.Add1TableAdapter.Fill(Me.Db1DataSet1.add1)
        Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
        Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
        Dim S As String
        Dim datagrid1 As New DataGrid
        S = "select * from add1 where fname='" & TextBox1.Text & "'"
        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
        da.Fill(Db1DataSet1, "add1")
        datagrid1.DataSource = Db1DataSet1.DefaultViewManager
    End Sub

    Private Sub Db1DataSet1_Initialized(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)

    End Sub

    Private Sub DataGridView1_CellContentClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub Add1BindingSource_CurrentChanged(ByVal sender As System.Object, ByVal e …
Kshiteesh 0 Newbie Poster

Dear frens,

I m still facing the same problem, I m using VB.net 2007. when i use

Private Sub name_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim s As String
        Dim tmp As ADODB.Recordset
        Dim ds As New DataSet
        Dim datagrid1 As New DataGrid
        Dim dataview As New DataView
        Dim da As New OleDb.OleDbDataAdapter
        Dim ds1 As New DataSet
        con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
        con.Open()
        s = "select * from add1 where fname='" & TextBox1.Text & "'"
        tmp.Open(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
        Dim ConnStr As String = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"""
        da = New OleDb.OleDbDataAdapter(s, ConnStr)
        ds = New DataSet da.fill(ds, add1")
        datagrid1.DataSource = ds.Tables("add1")
        datagrid1.fill(da, "add1")
    End Sub

In the aforementioned code I get problem when I write

ds = New DataSet da.fill(ds, add1")

it shows build error showing
end of statement expected

and

datagrid1.fill(da, "add1")

shows build error showing
'fill' is not a member of 'System.Windows.Forms.DataGrid'.

I don get any point please help me...and please explain how to overcome this problem. I don't have much time coz most of my time has been lost in this problem.

please help

Kshiteesh 0 Newbie Poster

Hi frens.

Thank you for the help

You gave the code for saving and displaying data in datagrid in SQL.

However, I have MS Access in backend so I faced certain difficulties in it. I also followed Queen V's instructions but it didn't solve my problem. Please Help so that I can do it well.

Private Sub name_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As New ADODB.Connection
        Dim tmp As New ADODB.Recordset
        Dim s As String
        Dim DA As New OleDb.OleDbDataAdapter
        Dim oledbdataadapter1 As OleDb.OleDbDataAdapter
        Dim db1dataset1 As New DataSet
        Dim DS As DataSet
        Dim datagrid1 As New DataGrid
        con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
        con.Open()
        s = "SELECT * FROM MyTable where fname='" & TextBox1.Text & "'"
        DA = New OleDb.OleDbDataAdapter(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
        DS = New db1DataSet1.add1Row(DS, "add1")
        DatGrid1.DataSource = DS.Tables("add1")
    End Sub

Please help wot is the problem with my code.

Anticipating ur replies.

Kshiteesh

Kshiteesh 0 Newbie Poster

Thank you for the reply ......

I did as you said QVeen 72 but it asks oledbdataadapter to be defined and it doesnot recognises new dataset ds it posts an error when you post

DS = New DataSetDA.Fill(DS, "TabName")

It also asks datagrid1 to be declared....I m a bit vague on it. I declared datagrid1 as datagrid in the load event and

Dim DA As OleDb.OleDbDataAdapter

but the problem still persists...

Please help me wot to do????

Kshiteesh 0 Newbie Poster

HI all .....

I am beginner of VB. net. I m developing a vb.net application program to store, update and search contact information and address. I have completed the data. I have used ms access as my backend. I enter data like wise;

Dim con As New ADODB.Connection

        Dim tmp As New ADODB.Recordset
        Dim s As String

        con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=K:\Database\db1.mdb"
        con.Open()
        s = "select * from add1"
        tmp.Open(s, con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
.
.
.
tmp.AddNew()
        tmp.Fields("ID").Value = T18.Text
MsgBox("Record Saved")
        Exit Sub

And to search these type of data i have used separate forms by providing the links of forms in an one search form.

I have given parameters like name, country, org, email to search the contact. I need to show them in a data grid in the form. suppose i insert name in the text box and press button search then the resembling names and their information should be displayed in the data grid. I would be very grateful if anyone helps me to solve this problem.

Waiting for the replys.

Sincerly
Kshiteesh

Kshiteesh 0 Newbie Poster

Dear all,

I have been preparing an address management system using ms access as backend and vb.net as front end.

I have got a problem in using search button. How can I display searched datas in access files in grid. (can i get a code for it if you really know). and how can I display those records in the format like

Mr. Hari Alam
SAWTEE
254 Lamtangeen Marg
Baluwatar, Kathmandu

and display different blocks of data in word so that i can use them to print and cut and paste in the envelopes to send post mail to users.

please help me and please be specific and do not forget to write the code as well .....

Anticipating

Kshiteesh

Kshiteesh 0 Newbie Poster

Dear all,

I am a Bachelor in Information Management Student(BIM) in Nepal. I have got an assignment to develop an Address management software in my internship. I am a begineer of VB.net. Please suggest me how should I develop it. Should I develop a network or only a desktop program. I will probably use msaccess as a backend database. Please suggest me should i be using sql of msaccess and why. I would be grateful to everyone who answers my threads.

Thank you

Kshiteesh