|
u have to specify the datasource, do databind, specify datavalue and datatext field
ddlist.DataSource = dataset1.Tables(0)
ddlist.DataBind()
ddlist.DataValueField = "column name"
ddlist.DataTextField = "column name"
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
You don't understand!!
I have the following piece of code:
Protected WithEvents ddlID As System.Web.UI.WebControls.DropDownList
In a method where I try to populate this drop down list:
ddlID = Me.CreateDropDownListForFileFields(columns)
CreateDropDownListForFileFields looks like this:
Private Function CreateDropDownListForFileFields(ByVal columns As DataColumnCollection) As DropDownList
Dim ddl As New DropDownList
Dim column As DataColumn
For Each column In columns
ddl.Items.Add(New ListItem(column.ColumnName, column.ColumnName))
Next
ddl.Items.Insert(0, New ListItem("Please select...", String.Empty))
' Return
Return ddl
End Function
Please see if you can help me know.
Regards
ma se
|
|
|
|
|
This question really should have been asked in the ASP.NET forum, reguardless of the language you used.
But, in Windows Forms, any control must be added to the form's Controls collection. I'm guessing that the same is true for an ASP.NET Form.
Me.Controls.Add(ddl)
|
|
|
|
|
Hi
How to read the email address from the inbox folder of outlook into vb.net?
am using .net1.1 version.Please guide me in solving this query.
Thanks
Aruna
|
|
|
|
|
What email address?? An inbox doesn't have one.
Are you talking about the email address your customer is using to send/receive email? Or are you talking about getting the source email address of a message in the inbox?
|
|
|
|
|
Hi
I need the sender email addresses from the inbox of outlook in vb.net.
|
|
|
|
|
With Outlook Express, you'd have to use the MAPI API to do it. With the full Outlook client, you'd have to use the Outlook object model. Which is it?
|
|
|
|
|
how can i get complete system information through VB / VB.NET
Regards
Raj Mohan
|
|
|
|
|
Define complete.
You can access:
System.Management, for WMI.
WMI has a lot of info in it.
System.Environment, for general local machine stuff.
System.DirectoryServices, for active directory.
|
|
|
|
|
Hi, you can use the Process class to execute file
C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe
You would need a lot of code it you wanted to obtain most of that information
into your program's variables.
|
|
|
|
|
You can also use the shell function call the "dxdiag" command
just use
shell("dxdiag")
it will open a window with all system information
or use
my.computer.BLAHBLAH
namespace and get the system information
hope it will help
-regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
he tell me there is an error on the insert statement
and iam sure from the names of the feilds coz i copy it from database
so what's wrong???
i don't know where is the error plz anyone answer me
thanks
cmd.Connection.Close()
If cn.State = ConnectionState.Closed Then
If cn.State = ConnectionState.Closed Then
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ehab.mdb"
cn.Open()
End If
cmd.Connection = cn
cmd.CommandType = CommandType.Text
End If
Dim s As String
Dim h As Integer
s = 0
h = 0
Dim f1, f2, f3, f4, f5, f6, f7, f8 As String
f1 = "'" & DateTimePicker1.Value & "',"
f2 = "'" & ComboBox1.Text & "',"
f3 = "'" & ComboBox2.Text & "',"
f4 = "'" & TextBox1.Text & "',"
f5 = "'" & TextBox2.Text & "',"
f6 = "'" & TextBox3.Text & "',"
f7 = "'" & TextBox4.Text & "',"
f8 = "'" & Label10.Text & "'"
s = "insert into sale "
s = s & " (dte,op,value,nos,cost,coms,nii,npp )values "
s = s & "(" & f1 & f2 & f3 & f4 & f5 & f6 & f7 & f8 & ")"
cmd.CommandText = s
h = cmd.ExecuteNonQuery()
MsgBox("Saved succssefuly")
|
|
|
|
|
On the line:
s = s & "(" & f1 & f2 & f3 & f4 & f5 & f6 & f7 & f8 & ")"
You need to seperate the values with commas
s = s & "(" & f1 & "," & f2 & "," & f3 & "," & f4 ... etc
I would recommend using Stored procs though as you are performing no validation and are wide open to injection attacks
|
|
|
|
|
Hi,
I think he had given it. He assign values in those variables along with ',' also.
I cant find an error.
Thank you.
|
|
|
|
|
thanks for ur reply
but it still gives the same error
here what i wrote
s = "insert into addcard"
s = s & " (dte,op,nos,cost,coms,nii,npp )values "
s = s & "(" & f1 & "," & f2 & "," & f3 & "," & f4 & "," & "," & f5 & "," & "," & f6 & "," & "," & f7 & "," & f8 & "')"
cmd.CommandText = s
h = cmd.ExecuteNonQuery()
MsgBox("Saved succssefuly")
plz give me ur feedback
|
|
|
|
|
Could you give an indication as to the error which is being returned from SQL when you try and execute the query?
|
|
|
|
|
magedhv wrote: here what i wrote
s = "insert into addcard"
s = s & " (dte,op,nos,cost,coms,nii,npp )values "
s = s & "(" & f1 & "," & f2 & "," & f3 & "," & f4 & "," & "," & f5 & "," & "," & f6 & "," & "," & f7 & "," & f8 & "')"
Is this an exact copy from your code? If so, there is an extra ' at the end.
Also, what is the type of field dte in your database? If it is a date, you cannot pass in a string, AFAIK.
What is the error message you get, anyway?
|
|
|
|
|
he gives me this error msg
Syntax error in INSERT INTO statement.
all of the fields in database are number except dte it's type (date/time)
plz help me cause it drive me crazy
|
|
|
|
|
magedhv wrote: Syntax error in INSERT INTO statement.
all of the fields in database are number except dte it's type (date/time)
Ok - but did you check out the suggestions I made earlier? Date fields cannot be passed in as strings to Jet databases.
|
|
|
|
|
try this code,if still there is any error let me know
cmd.Connection.Close()
If cn.State = ConnectionState.Closed Then
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ehab.mdb"
cn.Open()
End If
cmd.Connection = cn
cmd.CommandType = CommandType.Text
End If
Dim s As String
Dim h As Integer
s = 0
h = 0
f3 = "'" & ComboBox2.Text & "',"
f4 = "'" & TextBox1.Text & "',"
f5 = "'" & TextBox2.Text & "',"
f6 = "'" & TextBox3.Text & "',"
f7 = "'" & TextBox4.Text & "',"
f8 = "'" & Label10.Text & "'"
s =
s = s & " "
s = "insert into sale (dte,op,value,nos,cost,coms,nii,npp ) values('" & DateTimePicker1.Value & "','" & ComboBox1.Text & "','" & ComboBox2.Text & "','" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & Label10.Text & "')"
cmd.CommandText = s
h = cmd.ExecuteNonQuery()
MsgBox("Saved succssefuly")
|
|
|
|
|
syntex error
do u have another solution
i have already use this code in another form and it works well (in my first topic )
i don't know what's wrong
|
|
|
|
|
he gives me error when i tried to enter 2 values
this is the error
syntax error (missing operator) in query expression '7/2/2007Vodafone'.
|
|
|
|
|
magedhv wrote: syntax error (missing operator) in query expression '7/2/2007Vodafone'
It looks like you dont have the two fields separated - shouldnt it be '7/2/2007','Vodafone'...
Also, the first is a date field, IIRC date fields for Jet databases should be enclosed by # not quotes.
|
|
|
|
|
plz write 4 me the code of the date to try
thanks i appreciate your efforts
|
|
|
|
|
Just remember this...
for text (string) variables, enclose data in quotes - like 'Vodafone'
for number variables, just the value will do
for date variables, enclose data with # - like #7/2/2007#
and between each field, you should have a comma.
Hope this helps.
|
|
|
|
|