Pgmer 50 Master Poster Featured Poster

Hi Anuj.. Thanks..
I found the sollution for my problem.
:)

Pgmer 50 Master Poster Featured Poster

Write property in your class which sets or gets the Connection string. which should be public. and create the instance of this class in the form where you want to set the connection string from textbox and access the proprty and set it.

Exapmle..

Dim M_connstring as string
Public Property ConnString as string
 Get
            ConnString = M_connstring 
        End Get
        Set(ByVal Value As String)
            M_connstring = Value
        End Set

In the form where u want to set this property

Dim objCls as new ClassName
ObjCls.ConnString=textbox.text

Hope this helps you.

Pgmer 50 Master Poster Featured Poster

Use split function and get only ABC-01

Pgmer 50 Master Poster Featured Poster

Hi All,

SELECT
            'Name A ' as Column0, 
		Some column  as Column2,		
	      FROM  MyTable
WHERE 	my condition

UNION 

SELECT 
	       'Name  B' as Column0, 
		Some other column  as Column2,		
	      FROM  MyTable
WHERE 	my condition

I want to concatenate the rowNumber with column0 any idea how to do that?

Thanks & Regards,
Vadiraj

Pgmer 50 Master Poster Featured Poster

Could you please explain in detail? What you mean by not fecthing data from server?
Any error?

Pgmer 50 Master Poster Featured Poster

Ur comparring the literal strings here so try using TRIM function on both side..
And why ur doing the loops seperately?.
you need to compare all the postcode with zipcode right?

you can write one sp which takes Postcode as paramaeter and do the search in DB instead doing at front end if value found return true or else return false.

Pgmer 50 Master Poster Featured Poster

Get all the excel values into dataset and do loop and compare..

Pgmer 50 Master Poster Featured Poster

you mean u want to verify the row already exist or not in SQL? IF not exist u want insert if exist dont insert?

Pgmer 50 Master Poster Featured Poster
Dim userString as string
dim ActualString as string="123abc"
userString =textbox1.text
If userstring=actualstring then
messagebox.show("String Found")
Else
messagebox.show("String not Found")

End IF
Pgmer 50 Master Poster Featured Poster

Hi Mitja,

Yes this may works.. but as the list will be huge i would like to avoid looping.
LINQ will be best idea.. let me try..
Thanks for ur reply..

Pgmer 50 Master Poster Featured Poster

Hi,
Im using one third party grid which provides me a mthod called getarray to get the collection of the columns into two dimentional array.
fisrt column is checkbox, My need is If checkbox is checked i want to check wheater user entered data in another column or not.
Now im able to get all the rows and two colmns into array. i dont want to loop through all the records.
Hope i made it clear.. if not plz ask..

Thanks

Pgmer 50 Master Poster Featured Poster

Hi All,

I have two dimentional array, i want to filter the records in array
is there any way to do it?

Pgmer 50 Master Poster Featured Poster

you want some application has to run at perticular time?
You can write windows service for it and set the timings when to execute..

Pgmer 50 Master Poster Featured Poster

Hi adata post can he use Hiden Fileds also?

Pgmer 50 Master Poster Featured Poster

Why u want to show admin username/Password its aleready provided by OS right?..

Pgmer 50 Master Poster Featured Poster

Yes write it in modlue level. so that all the methods in all the form can use it..
Log the Stracktrace in textfile so that developer will come to know where the error is..

I heard using try catch finally block everywhere is expensive... so do some R&D on try catch and use accordingly..

Pgmer 50 Master Poster Featured Poster

What exactly you want? write what u want dont just say plzzz reply and all

Pgmer 50 Master Poster Featured Poster

Are you using the data base to store Employee details? IF yes which database ur using?
in radio button changed event write code to query ur database to filter the records and show it wherever you want to.

Pgmer 50 Master Poster Featured Poster

ohh ok I am very sorry i think i have not read it properly before replying.
sorry debasis and sorry jaseem.

debasisdas commented: :) +9
Pgmer 50 Master Poster Featured Poster

sorry we need to add Imports Microsoft.VisualBasic.Compatibility this reference i think.
but jahseem aheamd is not clear he is using vb.net or vb6 code..

Pgmer 50 Master Poster Featured Poster

if he is using vb6 code then why cant he try like this?

combobox1.Items.Add(New VB6.ListBoxItem(rs.fields("code").ToString(), rs.fields("Description").ToString() ))

and the he can access the data using vb6.getitemdata. why to make call to server each time? its expensive i guess..

Pgmer 50 Master Poster Featured Poster

Yes debasis, i asked the same to jaseem.
No need to assign the value to textbox in loop.

cant we get the data into dataset and assign that dataset to combo with value meber and display member? and in selected index changed event we can get the value member of that index and show up in textbox???

Pgmer 50 Master Poster Featured Poster

what you mean by like excel here? you want to have filter like excel filter? or just filtering the records in grid?

Pgmer 50 Master Poster Featured Poster

I have a question for you..
Why your assigning the text1.text=rs!Description in loop?

you want to use the vb6 syntax or pure vb.net code?

why cant u assign dataset to combobox with datasorce property and set value meber and display member property of combo?

Pgmer 50 Master Poster Featured Poster

Can you please explain your problem?
you mean to say you want to search in database for perticular records?

Pgmer 50 Master Poster Featured Poster
VB6.SetItemData(combobox1, combobox1.Items.Count - 1, False)

This is the code i need to convert. is this code setting the valuemember of combobox at the perticlaur index?

Pgmer 50 Master Poster Featured Poster

Thanks for reply,
Im adding the items to combo using objects.
I just want to know what is vb6.Setitemdata will do?
i think it just Sets the valuemember of combobox at perticular index.

Thanks.

Pgmer 50 Master Poster Featured Poster

Thanks AndreRet,
It would be great help if you can get me the sollution.
waiting for your reply soon..:)

Pgmer 50 Master Poster Featured Poster

Hi AndreRet,

Im converting some vb6 code to vb.net. in some places we are using
vb6.setitemdata(combobox,Combobox.selectedindex,Value)
i want to write the Equivalant code. basically i dont know vb6 much.

Pgmer 50 Master Poster Featured Poster

Hi all,
can anyone tell me how to write the .net code for vb6.setitemdata for combobox or listbox item?

Pgmer 50 Master Poster Featured Poster
Dim strS As String() = Nothing
            Dim actaulstring As String = ""
            strS = TextBox1.Text.Split(">")
            actaulstring = strS.GetValue(1)
            strS = actaulstring.Split("<")
            actaulstring = strS(0)
Pgmer 50 Master Poster Featured Poster

Getting any error message?
before doing cmd.executeNonQuery get the sql statement and try to run in sql server
so you will come to know any syntax error or somethng.

Pgmer 50 Master Poster Featured Poster

Yes Ranx That will be the good approach.. Thanks :)

Pgmer 50 Master Poster Featured Poster
Pgmer 50 Master Poster Featured Poster

you can fetch all the records in form load in background thread.
in click just filter out the records and show to the user, dont fecth from DB all the time.

Pgmer 50 Master Poster Featured Poster

how ur opening MS word in ur application?
ru using Shell command?
get the clip board text to variable and in MS word record the macro and paste ur content. Macro will write code in vb you may get some idea...

Pgmer 50 Master Poster Featured Poster

In search create table and add the records to new table and then assign that new table to grid as source.

Pgmer 50 Master Poster Featured Poster

Hi,

You can write Public get set property for that NUM and access

Pgmer 50 Master Poster Featured Poster

Try out in some other event which are available for control

Pgmer 50 Master Poster Featured Poster

Why you want to create? when create new project all those files will be created by VS only..

Pgmer 50 Master Poster Featured Poster

Please check the framework version in windows 7 and if you develoveped application in 32 bit processor and running it in 64 bit processor can also cause the problem. please check all those things

Pgmer 50 Master Poster Featured Poster

You can do like this also

Private Sub TextBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseClick, TextBox2.MouseClick, TextBox3.MouseClick, TextBox4.MouseClick...till textbox10
        Dim strName As String = ""
        Dim text As TextBox = sender
        strName = text.Name
        MsgBox(strName)

    End Sub
Pgmer 50 Master Poster Featured Poster

In mouse click event of textbox1... till textbox10 do

Dim strName as string=string.emty
strName=textbox1.name
Pgmer 50 Master Poster Featured Poster

Set your Log in form as startup form in project proerty.
Add the logic to authenticate the user. If user is authenticated user then hide the login form and show up ur MDI main form. in form_close event of MDI close ur hidden form also..

Pgmer 50 Master Poster Featured Poster

http://www.logiclabz.com/sql-server/split-function-in-sql-server-to-break-comma-separated-strings-into-table.aspx

Look at this link it may help you in understanding the SPLIT function in sql

Pgmer 50 Master Poster Featured Poster

Please explain your requirement clearly..

Pgmer 50 Master Poster Featured Poster

:) Sometime it happnes dont worry..
Happy coding..:)

Pgmer 50 Master Poster Featured Poster
'' Declare and assign connction to SQL Server
        Dim cn As SqlConnection
        Dim strCnn As String = "Your connection string"
        cn = New SqlConnection(strCnn)
        Try


            ' Open up the connection
            cn.Open()
            ''Declare command object and pass commandtext and Connection to Command Object
            Dim comm As New SqlCommand("pr_GetData", cn)
            ''Set commandtype=Stored Procedure as ur passing the command text as SP
            comm.CommandType = CommandType.StoredProcedure
            '' Add parameter to SP
            comm.Parameters.Add("@Engg_Id", SqlDbType.Int)
            ''Pass the value 
            comm.Parameters("@Engg_Id").Value = "Pass your Eng Id"

            ''Declare Dataadapter 
            Dim da As New SqlDataAdapter(comm)
            Dim ds As New DataSet
            'Fill dataset with result set
            da.Fill(ds)

        Catch ex As Exception
            ''Handle Exception if any
        Finally
            ''Check if connection is open if yes please close it.
            If cn.State = ConnectionState.Open Then
                cn.Close()
            End If
        End Try

And Here is ur SP

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE pr_GetData 
	@Engg_Id as int
AS
BEGIN
	Select * from Engineers where ID =@Engg_Id 
END
GO

Instead of * please specify the column names you want get from server.

Please let me know if you need any help.
Happy coding.. :)

Pgmer 50 Master Poster Featured Poster

Hi,

Try to get the strsql before you perform retvalue = myCommand.ExecuteNonQuery()
and try to execute that in sql server, so you will come to know if any syntax error or something.

Pgmer 50 Master Poster Featured Poster

:) Happy coding...