2,634 Topics

Member Avatar for
Member Avatar for bestex

Hi all, heres my code [CODE]Dim con As New MySqlConnection("server=localhost; user id=root; password=phoenix0931; database=accounts;") Try con.Open() Dim dat As MySqlDataAdapter = New MySqlDataAdapter("SELECT customers_id,customer_name,customer_add FROM customers ", con) Dim dt As New DataSet dat.Fill(dt, "customers") ComboBox1.DataSource = dt.Tables("customers").DefaultView ComboBox1.DisplayMember = "customer_name" ComboBox1.ValueMember = "customers_id" Catch ex As Exception MessageBox.Show(ex.Message) Finally …

Member Avatar for bestex
0
121
Member Avatar for bestex

I dont know what code to put Here? to get the exact value of my record on my database here is my code [CODE] Protected Const strConnPubs As String = "server=localhost; user id=root; password=phoenix0931; database=accounts;" Protected strPubsCMD As String = "select customers_id, customer_name from customers" Protected dvName As DataView Protected …

Member Avatar for bestex
0
213
Member Avatar for zy_430l

hi, im a newbie in using vb2008 and mysql server 5.1. i tried creating a dataset using the myodbc driver 5.1 (which im sure is correctly typed in because that is the exact same connection string i used for data manipulation within my app. now, im stuck. i cannot generate …

Member Avatar for tomason
0
623
Member Avatar for HMehrpouya

[QUOTE] I want to have two classes one for creating the dataset as a factory class and the other is my Dataset class. factory class could read data from files or memory address and also it can create random data and finally returns a dataset. first i want to implement …

0
59
Member Avatar for Asim Javaid Far

I am asim, hi, i have uploaded my site first time and but unfortunately i got errors in web.config file that is as below: [CODE]<?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" …

Member Avatar for Fortinbra
0
250
Member Avatar for nengstrom

Hi Everyone! I am a beginner at VB. I have been a systems admin for some time and my new employers are forcing my hand into programming. I am currently Trying to write custom software that interfaces with our Advantage Database. I have the data source and connection opening fine. …

Member Avatar for nengstrom
0
165
Member Avatar for vn412

Hi, I've a problem handling dataset. I have 3 tables in access database. In loop i am firing query to select values [CODE] for i=1 to 3 sql= " SELECT field FROM tbl where some condition" [/CODE] Now i execute the query to get dataset(ds) as output. [CODE] next [/CODE] …

0
54
Member Avatar for vb.net beginner

hello all.. Hi, I'm having problem to read *.DBF (DBase File) using VB.NET. Below is my code : [code] Public abc As String = "C:\Documents and Settings\LASIM\My Documents\20100126a\JADUAL\TCMSV2" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql As String Dim connection As String Dim dsXML …

Member Avatar for lolafuertes
0
727
Member Avatar for AngelicOne

I have a datagridview that is being populated by a dataset using an SQL table. How can I implement a backup and restore? Would I use the SQL select into statement?

Member Avatar for darkagn
0
49
Member Avatar for bettybarnes

this is the error message... The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Admission_Record_PT_Chart". The conflict occurred in database "HospitalManagementSystem", table "dbo.PT_Chart", column 'Chart_ID'. The statement has been terminated. my code is [CODE]Imports System.Data.SqlClient Public Class Admission Private cs As New SqlConnection("Data Source=SAbio;Initial Catalog=HospitalManagementSystem;User ID=sa;Password=TRACERT123") Private da As New …

Member Avatar for bettybarnes
0
241
Member Avatar for Asen

I generate my xml into "variable string str" by using "dataset.GetXml" and then I write the "xml which is contained in variable str" into "file.xml" by using "sFile.WriteLine(str) while 'sFile' is a stream reader" My reason for using 'writeline' instead of 'dataset.WriteXml' because I need to encrypt the 'xml stored …

Member Avatar for Asen
0
196
Member Avatar for Gazzmonkey

Hi all, I've got a small problem with a database I'm working on, the project was given to me by college kids & their Teacher to complete. They created the database using Access 2007 and I'm left building a Windows App user interface in Visual Basic. Anyway I can't figure …

Member Avatar for Gazzmonkey
0
136
Member Avatar for ryathegr8

hi em trying to fetch Employee information from db and load it in Gridview....i select departemnt name and Grade from dropdownlist and pass it in query buh it returns Invalid column name 'InformationTechnology' and Invalid column name 'Grade17' [CODE]String strCon = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection objcon = new SqlConnection(strCon); objcon.Open(); // String …

Member Avatar for ryathegr8
0
158
Member Avatar for 303factory

Good afternoon I have recently had to switch from using VB.Net to using C#. The software I am trying to write needs to hold a DataSet in memory (consisting of about 5-10 tables). Then depending on user interaction, data will be added to or read out from the DataSet and …

Member Avatar for lolafuertes
0
129
Member Avatar for darkelflemurian

hello guys, i have the following question/problem: -what i need to do is to get some data from sqlserver and send it to a dataset(no problem there) after i get the dataset filled i need to send the columns and rows to a textfile but i have to separate the …

Member Avatar for darkelflemurian
0
111
Member Avatar for jonnod123

Hi All, Just a quick question to see what others think is the best preactise... You have an Windows application that connects to a SQL Server DB. You use a dataset to represent the database locally. Is it better to write queries locally in your dataset, or in SQL Server …

Member Avatar for jonnod123
0
100
Member Avatar for ajinkya112

i need to ask one more question.... [CODE]private void bbn_Click(object sender, EventArgs e) { OleDbDataAdapter ad; DataSet ds1 = new DataSet(); if (comboBox1.SelectedIndex == 0) { string str1 = "select * from '"+comboBox1.SelectedIndex+"'"; OleDbConnection conn1 = new OleDbConnection(str); ad = new OleDbDataAdapter(str1, conn1); ad.Fill(ds1); dataGridView1.DataSource = ds1.Tables[0].DefaultView;[/CODE] i want the …

Member Avatar for jay.gadhavi
0
136
Member Avatar for erum

see teh code [CODE]<asp:DataList ID="DataList1" runat="server" Width="200%" > <ItemTemplate> <h4><asp:Label ID="DAtes" runat="server" Text='<%# Eval("date") %>'></asp:Label></h4> <asp:GridView AllowPaging=True ID="GridView1" runat="server" DataKeyNames=sessionid AutoGenerateColumns="False" CellPadding="4" Width="697px" style="margin-right: 0px" ForeColor="#333333" GridLines="None"> <RowStyle ForeColor="#333333" BackColor="#F7F6F3" /> <Columns> <asp:TemplateField HeaderText="Availability"> <ItemTemplate> <asp:CheckBox ID="chkgfln" Enabled=true runat="server" Text=Available /> </ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderText="sessionid" DataField=sessionid /> <asp:BoundField HeaderText="userid" DataField=userid …

0
170
Member Avatar for er.lokeshsharma

Hi everybody, My name is Lokesh and i am a newbie to crystal reports. Off late, I am facing tough time in implementing a requirement in my project using crystal reports. My requirement is to display columns in crystal report based on user's choice. For example, Lets say there is …

0
49
Member Avatar for himanshu_roy81

Hi I have a asp.net web form in which I display registered customers in a Dropdown. In the Dropdown I can choose one customer, and click a "Show data"-button. That should display all registered data about the chosen customer in Gridview.but i didn't get the result.plz help me.my code is …

Member Avatar for vuyiswamb
0
571
Member Avatar for johmolan

I have an Access relation database with a few tables. Customer, order, process1, process11, process130 etc. Customer Primary key is CID Order tabel har Primary Key OrderID and Forreign Key CID All the Processtables has ID as PrimaryKey and OrderID as Forreign Keys. The relations are set to 1 to …

Member Avatar for lolafuertes
0
66
Member Avatar for srilekha nikky

Hi I want to create upload file and i want to read the same file which is uploaded in c#.net I wrote a code like this can u please check it. [code]private void btnUpload_Click(object sender, EventArgs e) { if (openFileDialog2.ShowDialog() == DialogResult.OK) { filename = openFileDialog2.FileName; txtUpload.Text = filename; } …

Member Avatar for srilekha nikky
0
270
Member Avatar for eiallen

hi, Does anyone know how to sum fields in ms access using SQL and then place it in datagridview? I have a ms access table with fields 'Points' and 'FacultyID'. I would like to know how to sum all values on 'Points' field and place it in datagridview. Also, I …

Member Avatar for lolafuertes
0
109
Member Avatar for virusisfound

I have two problems 1. I have develop and Installed a project on my computer. that was work on my PC so many days. but now prject not work properly. It give me error message that [B]SQl connection not avaliable.[/B] Is their is any way to overcome this problem. Can …

Member Avatar for virusisfound
0
243
Member Avatar for Acidburn

Hi guys, I'm trying to get to grips with ADO, so I've installed SQL server 2008 and made a database and placed a table called Computers in it. Now ive got the following class... [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.OleDb; using System.Data; using System.Data.SqlClient; namespace …

Member Avatar for Mitja Bonca
0
188
Member Avatar for bklynman01

I'm having trouble getting some data from a combobox. I have a series of comboboxes that populate as you make selections from the boxes. Each combobox is using data that is pulled from a SQL database into a dataset. This all works. When I get to the last box, I …

Member Avatar for CodeWord
0
128
Member Avatar for gr8fasushi

Hi everyone, novice here. I'm having some major issues trying to figure out what's going wrong with my code. The general problem is that I can't get the foreign key in one of my child tables to populate the primary key from the parent table. I have a parent table …

Member Avatar for gr8fasushi
0
233
Member Avatar for dougancil

I have the following code: [code] Imports System.Data.SqlClient Public Class Main Protected WithEvents DataGridView1 As DataGridView Dim instForm2 As New Exceptions Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startpayrollButton.Click Dim ssql As String = "select MAX(payrolldate) AS [payrolldate], " & _ "dateadd(dd, ((datediff(dd, '17530107', MAX(payrolldate))/7)*7)+7, '17530107') …

Member Avatar for Pgmer
0
204
Member Avatar for pgollnic

I am having to use a DATAGRID instead of DataGridView because I want to merge 2 datasets into 1 using a keyed field to tie the two together(the merge of datasets). ds1.Tables[0].TableName="Header" ds1.Tables[1].TableName="Detail" y = ds1.Tables("Header").Columns.Indexof(KeyPart2parmfield) z = ds1.Tables("Detail").Columns.Indexof(ConCatParm) table1Column = ds1.Tables("Header").Columns(y) table2Column = ds1.Tables("Detail").Columns(z) relation = *New DataRelation("Click for …

0
53
Member Avatar for gr8fasushi

I'm having some problems trying to input records into a relational database. The design is really simple but I'm running into a wall when it comes to having the foreign key from my child table autopopulate the primary key from the parent table. I've made the connections in Access and …

Member Avatar for kvprajapati
0
165
Member Avatar for shwetank11

Hi everyone I have created a GridView having Columns as Marks1,Marks2,Marks3 and total the values of marks are entered through SQL Query and The GridView is bind to dataset now i want to Display Total in the front end not through the Sql query Please help me in this Regard!!!

Member Avatar for rohand
0
72
Member Avatar for dougancil

I am trying to run several stored procedures from my code and I get the error message that my sp's can't be found, but if I remove all of them but one, my code executes fine. I've tried this way to run my sp's: [code] Dim oCmd2 As System.Data.SqlClient.SqlCommand Dim …

Member Avatar for dougancil
0
129
Member Avatar for bored4

i'm trying to make a login form connected to an sql server database. my data base has records like this: fname - lname - minit each name in a separate column, and i wanted to use the name as the login username, so in the dataset designer i made a …

Member Avatar for Dheerajpro
0
531
Member Avatar for syll

Hi, I am trying to download data using a dataset, but I keep getting the error "Failed to enable constraints" On Debug, I get the suggestion 'Relax or turn off constraints in your dataset" refers to "aRow.EmployeeID" my dataset has this query: [CODE]select isnull(c.Answer,'') Answer,isnull(b.Comment,'') Comment from Questions a left …

0
73
Member Avatar for vn412

Hi, I m newbie in vb.net. Please can someone help me with crystal reports in vb.net with backend as ms-access 2007. I want my report should be printed by dataset populated via query. Please help me with some sample code. Thanks

Member Avatar for vn412
0
83
Member Avatar for dougancil

I have the following code: [code] Public Class Payrollfinal Private Sub Payrollfinal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load exportfileButton.Enabled = False Dim oCmd As System.Data.SqlClient.SqlCommand Dim oDr As System.Data.SqlClient.SqlDataReader oCmd = New System.Data.SqlClient.SqlCommand Dim _CMD As SqlCommand = New SqlCommand Dim adapter As System.Data.SqlClient.SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter …

Member Avatar for dougancil
0
645
Member Avatar for GrexP

Normally, when populating controls with data from a database I create a connection and then pass a SQL statement to create a DataReader. I then loop through the DataReader and populate the controls. Because I am creating the SQL statement on the fly I can query the database joining on …

0
113
Member Avatar for adarshcu

I have a property active to indicate status of an employee. Along with all the details, i extract the details from an employee table into a dataset, but however i am not able to get the value present in active as i get an invalid cast exception. This is the …

Member Avatar for sandeepparekh9
0
331
Member Avatar for johmolan

I use the binding navigatorsaveitem to save my data back to the database, but the way I am doing it today seems to take an awful lot of time. Ex: [CODE]Private sub .....SaveItem_Click(Etc Etc Etc)Handles ....Click Me.Validate() Me.Process1BindingSource.EndEdit() Me.Process2BindingSource.EndEdit() Me.Process3BindingSource.EndEdit() Me.Process4BindingSource.EndEdit() Me.Process5BindingSource.EndEdit() Me.Process6BindingSource.EndEdit() Me.Process7BindingSource.EndEdit() Me.Process8BindingSource.EndEdit() Me.Process9BindingSource.EndEdit() Me.Process10BindingSource.EndEdit() Me.Process11BindingSource.EndEdit() Me.TableadapterManager.UpdateAll(Me.DataSet) 'Then …

Member Avatar for johmolan
0
328
Member Avatar for pgollnic

I have a parent/child relation I am trying to create fow 2 datasets. The parent ds consusts of a range of PO Header information After I fill this dataset I loop through it getting the PO number. I then take that value and execute another sql statement on the DETAIL …

0
33
Member Avatar for Sai Isha

hello everyone, i have a gridview which i have already populated and i got a foreign key Faculty_ID, which i display on the gridview , Now i want to display the Faculty_Name for that Faculty_ID. Can anyone help me out to do this part???? MY CODES BELOW WORKS FINE.. jst …

Member Avatar for Sai Isha
0
433
Member Avatar for ryathegr8

hi i have coded for forget password module but getting an error that is attached with... dont know why its hapen....here is code [CODE]string strCon = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection objcon = new SqlConnection(strCon); objcon.Open(); string str1 = "'"+txt_EmpFP_Uname.Text+"'"; string str2 = "'" + txt_EmpFP_OldPass.Text + "'"; String query = "Select * …

Member Avatar for ryathegr8
0
311
Member Avatar for NitendraTRIC

i m creating project in vb.net i m facing problem with related tables how the data will insert in muliple tables. and correct data are displaying in text boxes from multiple tables can any body help me plz..... [code] con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Lecture'sManagement\Lecture'sManagementSystem\LectureManagement.mdb;Persist Security Info=True") da = New OleDbDataAdapter("select …

0
51
Member Avatar for drake10k

Hello, I have a WPF/C# ListBox with one column with several items loaded from an SQL Sever Compact Edition database. I'm trying to delete a selected item from the database, but I'm having difficulties getting the value of the selected item, and because of this it is always returned null …

Member Avatar for drake10k
0
477
Member Avatar for katiep23

Relatively new to VB.NET coding. Am creating a pretty simple console application that needs to insert over 50,000 records into an Oracle table (OleDB connection). I tried 3 different methods so far: Individual INSERT, insert using a dataset, & using INSERT ALL (commit every 25 records due to # of …

Member Avatar for katiep23
0
1K
Member Avatar for NitendraTRIC

i m creating one project in vb.net i m taking database msaccess. i m able to insert update delete when i m taking single table.but i m facing problem with multiple tables which is related to each other how to define the relationship between tables in dataset and how to …

Member Avatar for prvnkmr194
0
185
Member Avatar for jlivvers

Hi, in my project I need to allow the user (admin user) to have the ability to run custom queries on the database. Ive done this pretty simply whwer the user enters their query and the reults are set to a datagridview. It would also be great however to allow …

Member Avatar for sandeepparekh9
0
230
Member Avatar for SpiderWebs

[code] void databaseUpdate() { conString = "Data Source=(local);Initial Catalog=Northwind;Integrated Security=True"; con = new SqlConnection(conString); con.Open(); string quryString = " select * from Employees"; da = new SqlDataAdapter(quryString, con); ds = new DataSet(); da.Fill(ds, "Emp"); //dataGridView1.DataSource = ds.Tables["Emp"]; dataGridView1.Columns.Add("EmpID", "ID"); dataGridView1.Columns.Add("FirstName", "FirstName"); dataGridView1.Columns.Add("LastName", "LastName"); int row = ds.Tables["Emp"].Rows.Count - 1; for …

Member Avatar for SpiderWebs
0
161
Member Avatar for khurramraja

friends i am using reportviewer in asp in which i show the record through stored procedure and the prooblem is that i used a textbox and a search button in textbox i insert date. i want that after the given date all record shown in report viewer here i paste …

0
101
Member Avatar for kruxena

Hi guys, can you pls help me what is the vb code in retrieving my data in the database? my code is this. [CODE] Dim SandLine As String SandLine = txt1S.Text & "," & txt2S.Text & "," & txt3S.Text _ & "," & txt4S.Text & "," & txt5S.Text & "," …

Member Avatar for kruxena
0
134

The End.