2,634 Topics
![]() | |
hi guys... i can connect now to the mysql database and is able to display the database names (because i have 3 databases) in a combo box.. i was stuck up in displaying tables from mysql in a listview.. please help me solve this.. here are my codes: [code] Public … | |
[code] Imports System.Data.SqlClient Imports System.Data.SqlClient.SqlDataReader Imports System.Data.SqlClient.SqlConnection Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Inherits System.Windows.Forms.Form Dim myConnection As New SqlConnection Dim myCommand As New SqlCommand Dim ds As New DataSet Dim cmdtext As Integer Dim action As String Dim view As DataView Dim dr … | |
Hi Everyone, Can you look at this code because I am sure I'm missing something. I am trying to reset a Dataset. I have a form that has 1 text box and has 2 queries that locate the data. One is by customer ID and the other is by customer … | |
Hi, I want to make enter Textbox value in multiplication of 2,the value in the textbox is retrieved from database. This is my code: [code] int a = int.Parse(textBox3.Text); int b = int.Parse(textBox3.Text); int c = a + b; textBox3.Text = c.ToString(); [/code] I had retrieved value from the database … | |
i want to make a seacrh page using c# in asp.net.. at the first page, i want to display all the record in a gridview..then,after user click a search button, the result will appear in another gridview.. what should i put to visible the previous gridview and display only the … | |
![]() | I need to make UI in C# that works with an SQL DB. I thought piece of cake! I imported my DB files to the Visual Studio (add->existing item ->browes and add) I dragged the tables to my Forms & there were automaticly buttons like New, Delete, Save, next record,previous … |
I'm trying to move functions that I have created in my .h files into the .cpp files of my winForm application. I don't really know how to get this to work. Example code in .h: [CODE]void loadCustomerDetails() { SQLiteConnection^ ObjConnection = gcnew SQLiteConnection("Data Source=SwiftService.db3;"); SQLiteCommand^ ObjCommand = gcnew SQLiteCommand("SELECT * … | |
HI im new to asp.net and i want help when click insert button same record is inserted instead of new record. Pls reply asap as my project is based on this [code] using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; … | |
I'm using DataSet ReadXML() method to load XML files of records different tables, and all are working fine. But, I would like to have the exceptional handling that in case there're records in XML files got problem, e.g. invalid data format or exceed column width and etc, it will skip … | |
ive been told to put all my sql statement together but i jus keep getting lots of errors with local variables in my vc++ project. sql.h[CODE]#ifndef __SQL_H__ #define __SQL_H__ #include "stdafx.h" #include <iostream> #include <string> using namespace std; using namespace System::Data::SQLite; using namespace System::Data; using namespace System::Windows::Forms; using namespace System; … | |
Hi Everyone, Ive been messing around the OLEDB in C#, What im trying to do is create a program that would read from a Access Database, and then the user has the right to add,edit and delete a records. So far i can get the Database to display and are … | |
hi for all i have two stored procedure to retrive data from data base one before one week and the other before two week [CODE]ALTER PROCEDURE beforeweek AS select * from files where [date] < dateadd(wk,-1,getdate()) [/CODE] and the other [CODE]ALTER PROCEDURE beforeweek AS select * from files where [date] … | |
I think it's more difficult to ask than answering the question. I wanna ask my question with an example: You know that we can bind an object to a DataSource, and that object could be of any type. So suppose I've bound an object of type "MyClass" to DataSource of … | |
hi frnds,,,, here i want to access the data base and showing in the grid view without help of datasourse it will shows the error, the error is "The IListSource does not contain any data sources"" here my coding is as follows..... Protected Sub Page_Load(ByVal sender As Object, ByVal e … | |
Hey, im trying to get some information out of my database, which i have tableadapter and dataset. Both created with the VS2010. I have made 4 queries in the tableadapter taking different parameters, to make a WHERE clause in the sql sentence. But it simply doesnt work and i dont … | |
[CODE] OleDbDataAdapter o = new OleDbDataAdapter("select * from tblExam1", conn); DataSet ds = new DataSet(); o.Fill(ds, "tblExam1"); DataRow r = ds.Tables["tblExam1"].NewRow(); r["exam1ID"]=324; r["patID"] = patid; r["ypsos"] = 32; ds.Tables["tblExam1"].Rows.Add(r); ds.AcceptChanges(); [/CODE] no error message. execute code normally, but row did not inserted in db what i m missing? its access … | |
I want to search through an sql table called hardware for a partial serial numbers. I have the following code but there is something wrong with the way i am doing my sql query. hope someone out there can help me. [CODE] Public Function GetDatabysn() As DataView Dim SelectQry = … | |
I'm using VS2010 with .NET4 Hi all, I'm working on a program that spawns a childform for each row in a database at runtime. This required some custom solutions and prevented me from using the built-in database interactions. All of that is working well, but I'm at the point where … | |
I have an sql table called Stock with two fields called StockID and StockCode. I want the user to select the stockcode from a combo which in turn populates the stockid for that item into a lable on my form. I have already populated the stockcode into the combo but … | |
What is the connection string to write for importing mixed data from excel sheet to data grid My problem is, I have rows like 1 2 3 4 5 6 7 8 9 a b c d in excel sheet.But when I imported these rows only 1-9 imported succesfully but … | |
I work with Visual basic 2010 express and Sql server 2008 Express I established Person and Specialist tables data base .I want to make Insert /update/ delete Here object declarations in a module : [CODE] Public str As String 'string sqlcommand Public con As New SqlConnection("Data source =Sara\SQLEXPRESS ; initial … | |
can anyone tell me how to use if else statement using c# and MS Access database..this is my code.. [CODE] protected void Button2_Click(object sender, EventArgs e) { string path = Server.MapPath("App_Data\\dnis2010.mdb"); OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path); //con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\keOn_kAyFar\\Documents\\Visual Studio 2008\\WebSites\\DNIS\\App_Data\\dnis2010.mdb;Persist Security Info=False"; conn.Open(); string str … | |
[CODE]Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Dim j As Integer Dim conn1 As New SqlConnection Dim cmd1 As SqlCommand Dim dp1 As New SqlDataAdapter Dim ds1 As New DataSet Dim str1 As String str1 = "Insert into Feedback( Title,UserName,EmailId,Feedback,) Values('" & ((txtTitle.Text).Trim).ToUpper() & " … | |
Hello Frends I am getting an error. The details are follows, ERROR: Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 36: if (rdr.Read()) Line 37: { [COLOR="Red"][B]Line 38: matured_month = Convert.ToInt32(rdr.GetString(0));[/B][/COLOR] Line 39: matured_year = Convert.ToInt32(rdr.GetString(1)); Line 40: conn.Close(); CODE: protected void Page_Load(object sender, … | |
Hey everyone, New to the forums, as this will be my first post. Im having a problem with a tableadapter/tableadapter query. My query is: [CODE]SELECT * FROM subject_assessments WHERE (sa_id = @sa_id)[/CODE] sa_id is a varchar, if that is relevant in any way. My table adapters then look like this: … | |
Hi all, I'm attempting to get some numbers from an XAL database (MS SQL Server 2005). My query is below. There are some conditions commented out. If I add either one of the lower ones the query executes in a matter of seconds but if I replace them with the … | |
Guys, i want to obtain a label value that is within a datagrid; please have a look at the code bellow, and it gives me an NullRefException"Object reference not set to an instance of an object.": [CODE]Dim title As String=(DirectCast(VideoDetailsView.FindControl("lblTitle"), Label).Text())[/CODE] here is my, Data calling and asp.net code (Data … | |
What is the connection string to write for importing mixed data from excel sheet to data grid My problem is, I have rows like 1 2 3 4 5 6 7 8 9 a b c d in excel sheet.But when I imported these rows only 1-9 imported succesfully but … | |
i use crytal report with vb 2008 i make a dataset with 3 field: id (number), name (strng), salary (double) and i have 2 record: 1: id: 1, name: abc, salary: 1,000,0000 2: id: 2, name: def, salary: 2,000,0000 next, i make report on dataset and when show is true … | |
How do i add a row to a data source (datagridview)? dataGridView1.Rows.Add(textBox2.Text, textBox1.Text); that gives me an error saying: Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound. my datasource: [code] XmlDataDocument xmlDatadoc = new XmlDataDocument(); xmlDatadoc.DataSet.ReadXml("Filepath"); DataSet ds = new DataSet("Books DataSet"); ds … | |
In my C# winforms project I have a DataGridView which is displaying a View of two SQL tables. Is there a workaround for Updating the View from the DataGridView. Using a Save button on my form, At first I assumed I could update the View like this: [CODE]this.DataSet.EndInit(); this.ViewTableAdapter.Update(this.DataSet.View);[/CODE] Did … | |
I'm new to C# and am having a problem with databases, specifically updating a table with dataset contents. No exceptions are being thrown, the update method tells me one row is affected but there is nothing in the table! Code below, your help is appreciated. [code=c#] RSSDataSet.NewsItemRow newRow = rSSDataSet.NewsItem.NewNewsItemRow(); … | |
Hi, I have a windows form that adds new entries to a dataset via a datagrid using the updateAll method. Im passing in an id from another form and id like to specify this in the sata thats being written to the dataset. So by default the id would already … | |
Hi I have a simple MS Access database with some rich text fields. I have been trying to bind some RichTextBox controls in my form to these fields. When I used the following c# code: [CODE] Binding bd = new Binding("Text", ds, "Words.meaning", true); tbDesc.DataBindings.Add(bd);[/CODE] ds= my DataSet Words= my … | |
Hello I have a datagridview, and I would like to run some queries (fill queries). when I run a fill query, my dataggridview show only one row, depending on the query parameter. How can I run a query multiple times, without removing the previous rows? I am using the: [CODE] … | |
I am trying to pull coordinates for a form location out of a database and insert them into the Location property: [code] childForm.Location = new Point(/* coordinates go here */); [/code] I have tried doing a direct replacement with the DataSet (which didn't work): [code] childForm.Location = new Point((string)row["location"]); [/code] … | |
Hi every one, please could you help me in my project!! I'm trying to design a words game that's give you the first two letters from the word and you insert the rest to make a word (for now I'm just using "co" as example and I have just one … | |
Hi All, I have a problem with a datagridview (7 columns) of which last 2 columns are combo boxes. The datagrid view was set in design view with column names same as a table called OccRecStaff but without a datasource. Although the datagrid view works perfectly for the first 5 … | |
Hi everyone, I hope you can help me. I am using vb.net and trying to delete a row in an access database. Firstly, I find the row and confirm there's record. If there's a record I ask for deletion. I am using the values submitted via a text box. Here … | |
I am putting together an editor for an application I am creating. The data ultimately resides on a SQL server. The application loads some of the data from the server into a dataset, which is used by a bindingsource which is then used by a bindingnavigator. (wow that's a mouthful). … | |
Hi ,I work with vb.net 2005 . I want to know if I want to connect to data base with Ms Access which data source i can use (ODBC or OLEDB) I write the following code in form load event (by OLEDB) : [COLOR=#0000ff]Dim[/COLOR] conn [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]New[/COLOR] OleDb.OleDbConnection([COLOR=#800000]"Jet OLEDB:Global Partial … | |
Hi All, I am trying to loop through the values of a dataset. Using a 3-tier architecture...so the dataset is created in the BLL. Now i want to retrieve its values and proceed with my desired functionality for each value of the dataset. Can somebody help as I am new … | |
I am new to vb. I am trying to get a value for a textbox from a database according to the selected item in combobox. but i had this ex.message Operator '&' in not defined for string "select*from ......" and type 'dtarowview' Could anyone please tell me what is wrong … | |
Hello, The title of this thread perhaps does not explain my problem correctly. Actually i am developing a financial software for a company.The software is similar to a banking system. The software is being developed using VB 2008 and SQL Server 2008.The company has its branches located at different locations. … | |
Originally I was using Office Interop to import data, but that was a headache and a half for both me and my computer. Right now I'm attempting to load it with ACE, but my data grid isn't being populated. Once that's up and running I need to know how to … | |
Dear Friends, I am new in VB 2005 I have problem loadind data in report viewer ,data loaded suceessfully but it is not the current data. Deatailed: I am entering production details into the database (access 2007) .it will add successfully.Then i open production report there is no current updated … | |
Hi, I've created a VB .Net windows application that generates reports in excel files from a dataset. I use "New Excel.Application" to create the Excel instance, and push data into it from my dataset. During this process, I do not show the GUI of my instance of Excel to the … | |
I'm stuck. I currently have the following example file structure: X, Y, Z 0.000234E+04, 0.000244E+03, 0.000234E+04 0.000244E+03, 0.000234E+04, 0.000238E+05 0.000238E+05, 0.000244E+03, 0.000234E+04 I would like for the Scientific Notation to be converted to float or integer values: X, Y, Z 2.34, 0.244, 2.34 0.244, 2.34, 23.8 23.8, 0.244, 2.34 I … | |
I can't seem to find out why it doesnt work with average or smallest but largest and sum does work. //constructor public class DataSet { private int sum = 0; private int count = 0; private int Smallest; private int largest; public DataSet() { } public void addValue(int a) { … | |
I can't think of a way to get rows out of a table. It was easy doing it with VB.Net and I'm just finding vc++ really difficult. This is what I have so far. I've connected to the database file and I am able to get the data shown onto … |
The End.