Hi Anuj.. Thanks..
I found the sollution for my problem.
:)
Pgmer 50 Master Poster Featured Poster
Pgmer 50 Master Poster Featured Poster
Pgmer 50 Master Poster Featured Poster
Hi Anuj.. Thanks..
I found the sollution for my problem.
:)
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.
Use split function and get only ABC-01
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
Could you please explain in detail? What you mean by not fecthing data from server?
Any error?
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.
Get all the excel values into dataset and do loop and compare..
you mean u want to verify the row already exist or not in SQL? IF not exist u want insert if exist dont insert?
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
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..
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
Hi All,
I have two dimentional array, i want to filter the records in array
is there any way to do it?
you want some application has to run at perticular time?
You can write windows service for it and set the timings when to execute..
Hi adata post can he use Hiden Fileds also?
Why u want to show admin username/Password its aleready provided by OS right?..
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..
What exactly you want? write what u want dont just say plzzz reply and all
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.
ohh ok I am very sorry i think i have not read it properly before replying.
sorry debasis and sorry jaseem.
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..
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???
what you mean by like excel here? you want to have filter like excel filter? or just filtering the records in grid?
Can you please explain your problem?
you mean to say you want to search in database for perticular records?
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?
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.
Thanks AndreRet,
It would be great help if you can get me the sollution.
waiting for your reply soon..:)
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.
Hi all,
can anyone tell me how to write the .net code for vb6.setitemdata for combobox or listbox item?
Dim strS As String() = Nothing
Dim actaulstring As String = ""
strS = TextBox1.Text.Split(">")
actaulstring = strS.GetValue(1)
strS = actaulstring.Split("<")
actaulstring = strS(0)
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.
Yes Ranx That will be the good approach.. Thanks :)
Hi read the following links,
http://www.codedigest.com/CodeDigest/146-Programmatically-refresh-an-aspx-page-from-CodeBehind-using-C--and-ASP-Net.aspx
http://www.knowdotnet.com/articles/asppagerefresh.html
you myt get some idea.. I am not good in web applications..:(
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.
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...
In search create table and add the records to new table and then assign that new table to grid as source.
Hi,
You can write Public get set property for that NUM and access
Try out in some other event which are available for control
Why you want to create? when create new project all those files will be created by VS only..
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
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
In mouse click event of textbox1... till textbox10 do
Dim strName as string=string.emty
strName=textbox1.name
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..
Look at this link it may help you in understanding the SPLIT function in sql
Please explain your requirement clearly..
:) Sometime it happnes dont worry..
Happy coding..:)
'' 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.. :)
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.
:) Happy coding...