|
The tells the SQL server to execute a stored procedure, called "sp_Popularity", stored in the database specified in the connection string.
The stored procedure in the database runs on the SQL Server and returns a set of records. The ExecuteReader method returns a SqlDataReader object that the DataSource property of the DataGrid uses to retrieve those records.
In order to get the code to work, you'd need a connection string that specifies a database to connect to on an SQL Server, and either a SQL "SELECT" statement or stored procedure that returns records from that database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave, I knew there was something missing.
I can get it to work the way I have been taught but I don't know how proficient it is ie:
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
‘added the dsAuthors.Clear() method which clears any present data
dsAuthors.Clear()
‘added this statement to get the dsAuthors dataset I created
SqlDataAdapter1.Fill(dsAuthors)
‘added This was to bind the Datagrid I made
DataGrid1.DataBind()
DGKenn.DataBind()
|
|
|
|
|
I am not sure how he gets the data from the database using the code he has. If I try just using that code it does nothing and rightfully so since I can't see where he is getting the db info.
Remember I am a real newbie here to programming
|
|
|
|
|
I am new to VB.Net and I having some difficulty with the new codes.
I wrote the following code in VB6 and trying to implement the same technique in VB.Net.
autosql = "select * from orders"<br />
Set myorder = mydb.OpenRecordset(autosql, dbOpenDynaset)<br />
<br />
If myorder.EOF Then<br />
x = 1<br />
Else<br />
myorder.MoveLast<br />
x = myorder!autono + 1<br />
End If<br />
addordstring = "insert into orders values(" & x & ",'" & mebdate & "','" & txtaccount & "','" & phone & "','" & coname & "','" & psgname & "','" & cabno & "','" & authname & "','" & driver & "','" & mebpick & "','" & wait & "','" & mebdrop & "','" & from & "','" & txtto & "','" & fare & "')"<br />
<br />
Set addorder = mydb.CreateQueryDef("", addordstring)<br />
addorder.Execute<br />
MsgBox "New entry has been added", vbOKOnly + vbExclamation, "Success"<br />
clear<br />
End Sub
Can someone help please.
Thanks.
|
|
|
|
|
|
Hello
I was trying to find a solution to my problem with combobox
Here is my problem. I have 2 combobox and I have created a realtionship between them, so the value of the second combo will depent on the selection of the first. Now my problem is how do I get the AccountID from the second box ?
Here is the code(I'm using access DB):
" Dim ds As New DataSet
Dim cmdString As String = "select * from tblOrganization"
Dim da As New OleDb.OleDbDataAdapter(cmdString, con)
da.Fill(ds, "tblOrganization")
cmdString = " select * from tblAccount"
da = New OleDb.OleDbDataAdapter(cmdString, con)
da.Fill(ds, "tblAccount")
Dim relation As New DataRelation("ArtAuth", _
ds.Tables("tblOrganization").Columns("Organization _ID"), _
ds.Tables("tblAccount").Columns("OrganizationID") _
)
ds.Relations.Add(relation)
cbOrg.DataSource = ds
cbOrg.DisplayMember = "tblOrganization.Organization_Name"
cbOrg.ValueMember = "tblOrganization.Organization_ID"
cbAccount.DataSource = ds
cbAccount.DisplayMember = "tblOrganization.ArtAuth.AccountName"
cbAccount.ValueMember = "tblOrganization.ArtAuth.AccountID""
|
|
|
|
|
Hi Guys!! Sorry for the mess i made with my ID. i actually couldnt register on your site so i had to use a login ID i got on the Net with a password. So i used it for the time being. Hey, i guess you guys didnt hear about David Smith who is implementing Bittorrent in C#. Well he has released a library in .NET which i can now use for my Project. Plz dont think of me as some lame Guy who just need good code to use in his own work. Im in my Final year of Information Technology and well im also a State Level Cricketer. I play for Mumbai, India, if you guys have heard of it. So i have very limited time to slog on my PC. Im doing this project with my GirlFriend and we need something that will help us like a Library, which could atleast make us understand what the Network Management actually performes. Anyways, i'll definitely keep in touch with you guys and let you know my progress. If i need some help, i'll be counting on you. Can I??? Thanx. Cya. Bye. Take Care you Guys. Code Project Rulezzzzzzzz!!!!!!!! ;)
Devraj Raut!!!
|
|
|
|
|
Devraj Raut wrote: Hey, i guess you guys didnt hear about David Smith who is implementing Bittorrent in C#. Well he has released a library in .NET which i can now use for my Project
Didn't I pointed it out to you here[^]
Devraj Raut wrote: Code Project Rulezzzzzzzz
That's better.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hey Colin!! This was for those guys who said that there is no Library in .NET for BitTorrent. Your Link was of great help. i heard the 55 min longinterview of David Smith. It was very interesting. i also got an open Sourse Bittorrent Client called BTSharp along with its Source. That might prove to be of enormous Help. Thanx Dude. Cya Later. CodePoject Rulezzzzzzzz!!!!!!!!!!
Devraj Raut!!!
|
|
|
|
|
Devraj Raut wrote: i also got an open Sourse Bittorrent Client called BTSharp along with its Source
I've been looking for that since I heard the interview a couple of weeks ago - But the site was down everytime I visited it. Is there a link to somewhere else with the source?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Yes there is a link to a .NET Library for implementation of the Bittorrent Protocol. Go to this link: http://cplan.cse.msu.edu/cs/blogs/smithiscrazy/
Here u will get the source code for BtSharp and also the Bittorrent.dll file which can be used in VB.NET.
Inform me whether it Helped you. I'm glad i could be of some help!!
Devraj Raut!!!
|
|
|
|
|
The last time a checked into it, there was no library. I think that was about a year ago.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a DLL contain both class and module, and I want to declare a public variable in the module and use it in other functions.
If I create multiple objects of the same DLL and this public variable can be set to different value in different object. Will this varaible cause any conflicts.
Thanks for your answer.
|
|
|
|
|
I'd like to accomplish the following, but have no idea how:
In my application I have this datagrid which displays customer names. I also have a textbox. I'd like to use this textbox to find records in the datagrid. When a user enters, for example, a few letters, the position of the row in the datagrid needs to be set to the customer name starting with those letters.
Is this possible, and if so, can anyone point me in the right direction?
Thanks in advance,
--Erwin
|
|
|
|
|
Hi!
I m using AXWebBrowser's navigate method navigate to target page..
page get displayed..fine..when user clicks a button or link a popup page is displayed ..what i want is to display the target page in the same window, i mean no popup but a normal (navigated/directed) page..how???
Note:sSerious comments plz
Thanks,
sufyan
|
|
|
|
|
You have to add a handler to your Browser:
AddHandler yourAxBrowser.NewWindow3, AddressOf reactPopUp
Private Sub reactPopUp(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NewWindow3Event)
Try
e.cancel = True
If Not e.bstrUrl = "about:blank" Then
yourAxBrowser.Navigate(e.bstrUrl)
End If
Catch
MessageBox.Show("Exception in reactPopUp-Function")
End Try
End Sub
greetings
tom
|
|
|
|
|
I am facing a problemin connecting a password protected MS-Access 2000 database with a Visual Basic6.0 Application. I am using ADO recordset.
Connection is working fine if I use DSN or use a older version of Access file. Can anyone solve my problem
deepaish
|
|
|
|
|
i want to make reports in vb 6.0.. when i use datareport how can i change the datas in the reports at run time?
|
|
|
|
|
Well, you want to change data for a particular field value, user will enter.
For this you can either connect a datareport using a recordset and then show the report.Before connecting design the report and field name you should be inserted as u will name then in query .
Or you can use a DataEnvironment SQL command with a parameter. In this case before calling the report pass in the parameter value to DataEnvironment Command .
deepaish
|
|
|
|
|
any way to log all the events from the MSN messenger popping up message windows , so i can see all names of ppl who logged in during the day ???
thanks.
|
|
|
|
|
hi,
How thes images will be loaded at run time in the following condition.
When user login into any application and if certain modules are being assign to him. So i want to dispaly the images of that modules.
for example:-
userA has 2 modules are assigned (Module M1& M2) so when userA login he will only see the images of moduleM1 and moduleM2 not other module Images
bhushan
|
|
|
|
|
Hi Guys,
I am a fresher in .NET. I am working on a project in VB.NET with MS Access as backend. I have searched several web sites. However, all of them provide similar information when it comes to database connectivity. I want to know if the application can connect to the database without us having to hard code the path to the database in the code.
Also, if the application is deployed on a different system on a different drive(this may matter if the database path is hard coded), then how do we overcome this issue.
Thanks in advance.
mayhem
|
|
|
|
|
Instead of hard coding you can use FileOpenDialog and that file path can store in any one text box that will call in you code, saystrConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data " & "Source=" & txtMdbPath.Text & ";")
Johnson
|
|
|
|
|
Hi Johnson,
Thnx for your reply. I understand that this can be done the way you mentioned. However, is it feasible to allow a user to perform these tasks. Also, the users may not agree with it.
Is there a way like we have in asp where we can set the path at runtime using server.mappath...Also, the access db's will be stored in the same folder as the application.
thnx.
Mayur
|
|
|
|
|
There are several options. You can store the Database location in the registry or preferably in an application or user config file. You can then read the file at runtime and use a connection string as in the post above.
Jon
|
|
|
|