Forum: VB.NET Aug 26th, 2009 |
| Replies: 3 Views: 235 That means exactly what is says, probably there is a piece of code that is executed before this method and you leave the connection open. make sure you close the connection on that method. usually i... |
Forum: VB.NET Aug 24th, 2009 |
| Replies: 4 Views: 468 Oops that is true adatapost my bad.
thanks for correcting me. |
Forum: VB.NET Aug 21st, 2009 |
| Replies: 4 Views: 468 add this at the end.
DataGridView1.DataBind()
regards |
Forum: VB.NET Jul 29th, 2009 |
| Replies: 1 Views: 398 you need to import System.Data.SqlClient; then you can say this.
Dim con = new SqlConnection("Initial Catalog=DBName;Data Source=ServerName;UID=User;PWD=Pass;");
con.Open()
//Some code here... |
Forum: VB.NET Jul 21st, 2009 |
| Replies: 4 Views: 1,115 Ok, good to know.
take care. |
Forum: VB.NET Jul 21st, 2009 |
| Replies: 4 Views: 1,115 at the end put DataGrid.DataBind()
also is your datagrid allow to generate the columns automatically, if not i would like to see the datagrid structure and the exact field you are retrieving from... |
Forum: VB.NET Jul 17th, 2009 |
| Replies: 3 Views: 1,184 Lets say that in the loadmain you set text for a label like this
Label1.Text = "Load Main"
But you want to do the same thing if you click a button, then create a function called for example... |
Forum: VB.NET Jul 15th, 2009 |
| Replies: 7 Views: 510 Take a look of this thread http://www.daniweb.com/forums/thread203951.html
if still need help let me know. |
Forum: VB.NET Jul 8th, 2009 |
| Replies: 2 Views: 402 Let's say you have a variable temp
Dim temp As String = "05/02/2005"
Dim ar() As String = temp.Split("/")
TextBox1.Text = ar(0)
The result of ar(0) is 05 i hope that help you. |
Forum: VB.NET Jul 6th, 2009 |
| Replies: 11 Views: 859 In that case you right. and also check what samir said and post back if there was any enhanced. |
Forum: VB.NET Jul 6th, 2009 |
| Replies: 11 Views: 859 First of all to retrieve the ID, I would not use DataReader but this
id = Convert.ToInt32(oledbcom.ExecuteScalar())
and for the rest of the code, make sure your connection is open. |
Forum: VB.NET Jun 25th, 2009 |
| Replies: 6 Views: 1,244 Ok once you have a connection set up, the easiest way to go is using a dataset you can basically do this. i did not test this.
Dim statement As String = "SELECT EmployeeId, FName FROM tblEmployee"... |
Forum: VB.NET Jun 24th, 2009 |
| Replies: 3 Views: 436 Hi,
What do you have so far? what is the part that you do not understand how to do it?.
regards. |
Forum: VB.NET Jun 19th, 2009 |
| Replies: 3 Views: 1,017 |
Forum: VB.NET Jun 11th, 2009 |
| Replies: 3 Views: 1,017 maybe this can help you lets say you want the subtract from two dates and then get the days.
well any way you can find a lot information here
... |
Forum: VB.NET Jun 11th, 2009 |
| Replies: 2 Views: 670 Hi, you should open the connection cn.Open() and then cn.Close() also you have a problem and the insert statement you are calling label1.text as lable1.text.
besides that check your table and see... |
Forum: VB.NET Jun 11th, 2009 |
| Replies: 6 Views: 499 Can you show more code, beacuse I do not see the connection object something like this
and then |
Forum: VB.NET Jun 2nd, 2009 |
| Replies: 3 Views: 309 You can go to this link for more reference.
http://www.connectionstrings.com/
http://www.daniweb.com/forums/thread272.html
In a nut shell you need this
Dim cn As OleDbConnection
cn = New... |
Forum: VB.NET May 26th, 2009 |
| Replies: 5 Views: 683 Just double check this, I am not sure. but when you say this
For i As Integer = 1 To CheckBoxList2.Items.Count
I think the checkboxlist index start in 0. |
Forum: VB.NET May 26th, 2009 |
| Replies: 5 Views: 683 |
Forum: VB.NET May 26th, 2009 |
| Replies: 5 Views: 683 Make sure your dropdownlist does not have duplicate values, for example if you result set when you bind the sub category dropdownlist have a duplicate value, when postback is going to go back to... |
Forum: VB.NET May 22nd, 2009 |
| Replies: 3 Views: 806 Glad to know you are in the road.
You can do this also replacing the textbox1.text in the insert statement by @name and so one and then add this line for every single parameter
and so on.
... |
Forum: VB.NET May 22nd, 2009 |
| Replies: 3 Views: 611 Well, if you said it was working, the first thing i can think is check the path, is something change?
Regards. |
Forum: VB.NET May 22nd, 2009 |
| Replies: 5 Views: 597 In a nut shell, you want to make two queries and then put them together in a datagrid result, if that is the case, i supposed that both queries contain the same fields, you can use UNION between two... |
Forum: VB.NET May 21st, 2009 |
| Replies: 5 Views: 597 Ok, how are you passing the result set to the datagridview? threw a DataReader or DataSet, their both have a method that return if there is data.
DataReader.HasRows(), return true is the reader... |
Forum: VB.NET May 20th, 2009 |
| Replies: 3 Views: 806 well If you know how to make a connection with the database which i think you do, because you are getting data from the db. to insert a new record is much easier.
lets say that we have a table... |
Forum: VB.NET May 20th, 2009 |
| Replies: 1 Views: 390 Hi, I do not really understand what is your goal with this code, first of all this line does not seem right to me.
dim token as integer = 'something'
but anyway i think what you want is this.
... |
Forum: VB.NET May 19th, 2009 |
| Replies: 6 Views: 797 Try this
Select a.SubCat_Name from SubCategory as a inner join category as b on a.SubCat_Cat_id = b.Cat_id
where b.Cat_name = '" & DirectCast(e.Item.FindControl("chkCategory"), CheckBox).Text &... |
Forum: VB.NET May 18th, 2009 |
| Replies: 6 Views: 797 ok, i do not know if this is the best solution but it work.
I test this try to replace your statement in values, notice the event OnItemDataBound that makes the trick.
aspx
<table>
... |
Forum: VB.NET May 18th, 2009 |
| Replies: 6 Views: 797 well i can tell you right now why.
you are retreiving category and sub category and the same resultset and your data is show as example.
Category Sub_Categor
Network ... |
Forum: VB.NET May 11th, 2009 |
| Replies: 6 Views: 1,322 I think the best way to go is ddambe's way, or doing everything in one spot. this is c#, vb is similiar.
TextBox3.Text = Convert.ToString(Convert.ToDouble(TextBox1.Text) *... |
Forum: VB.NET May 7th, 2009 |
| Replies: 2 Views: 358 Hi,
I do not know if this can help but try it
replace dr(0) for dr.GetString(0) and dr.GetString(1).
also try in the select retrieve exact the two fields that you want, i do not know what is the... |
Forum: VB.NET May 7th, 2009 |
| Replies: 2 Views: 543 Can you show the insert statement specially the way you are passing those values.
Regards |
Forum: VB.NET May 7th, 2009 |
| Replies: 7 Views: 972 Yes because when you say 5/14/2008, the code assume 14 as month and there is not 14 month so change the dd/mm/yyyy to MM/dd/yyyy it should work.
regards |
Forum: VB.NET May 7th, 2009 |
| Replies: 7 Views: 972 Oh well sorry to hear that, Lets keep try.
String MyString;
MyString = "1999-09-01 21:34 PM";
//MyString = "1999-09-01 21:34 p.m."; //Depends on your regional settings
DateTime... |
Forum: VB.NET May 7th, 2009 |
| Replies: 7 Views: 972 I did not test this, but I think you can use this
DateTime dt;
dt = Convert.ToDateTime("5/20/2008");
I am assuming your are in C#. VB is basically the same thing
hope it works regards |