4,457 Topics
![]() | |
I am getting below Error “Update requires a valid InsertCommand when passed DataRow collection with new rows.” **Below is the code in Module** Module ModDBConnection Public CnCommon As New SqlConnection Public DTCodeMaster As New DataTable Public DACodeMaster As New SqlDataAdapter Public CBCodeMaster As New SqlCommandBuilder Public Sub CommonCn() CnCommon = … | |
I am completely new to the C# development world and I am working on a small application which will allow a user to add basic employee details to a employee table. I can get the code to add a row to the table but the question I asked myself is … | |
I have a text file which looks like this : Flooding refers to all water that overflows a node, whether it ponds or not. -------------------------------------------------------------------------- Total Maximum Maximum Time of Max Flood Ponded Hours Rate Occurrence Volume Depth Node Flooded CMS days hr:min 10^6 ltr Meters -------------------------------------------------------------------------- 1064 0.15 0.000 … | |
How can I specify the Server of my database when I make my project executable I have this module I call everytime i modify my database Public Sub main() constr = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:"database file".mdf;" & _ "Integrated Security=True;Connect Timeout=30;User Instance=True" Con = New SqlConnection(constr) Try Con.Open() 'MsgBox("Server Connection is Open … | |
Hello, I have been struggling a little bit with an issue in a relational database that supports queries. Originally I was going to use an OleDB data adapter and connect to an Microsoft Access database (created with Access 2000). The problem is that when I use a connection string like: … | |
Hi, I'm new in VB.NET and I'm having trouble with creating a **public sqlconnection** in a VB Module. I have declared **conn** as public sqlconnection but when I use it to the other forms its value is equal to "**nothing**". I hope you can enlighten me here. thanks in advance. … | |
i'm trying to make an autocomplete that will display the name of files in a folder. The autocomplete is ok except the part that it only display for the last file name. your help and suggestions much appreciated! =) code to open the folder and list the excel file names. … | |
Hey... If I just built a library for any open source software for C++, what file type should the library files come in? .a OR .o files? Thank you. | |
Has anyone ever used PLPLOT. I'm trying to compile one of the examples (which build successfully during the plplot build process) but I want to build the example individually. It's proving very challenging. A million linker errors and no clue on their website as to what is going wrong. I've … | |
I'm having a problem updating records from my VB.Net application to the database (Access Database). I've tried all sorts of update technique and i keep getting either "syntax error in update statement" or "data mismatch in criteria expression". heres the code i'm using: Public Function save1stsemester() 'this code updates 1st … | |
Hi, I am trying to insert values into my local SQL database. Here is my code: Imports System.Data.SqlServerCe Public Class AddSensor ' Shared variables Dim con As SqlCeConnection = New SqlCeConnection("Data Source=C:\Users\Bryan\documents\visual studio 2010\Projects\SiteSecure v1.1\SiteSecure v1.1\Database1.sdf") Dim cmd As SqlCeCommand Dim myDA As SqlCeDataAdapter Dim myDataSet As DataSet Dim oForm1 … | |
i have one datalist having shopping cart table which retrieves values as per customer_id aspx code. <asp:DataList ID="DataList1" runat="server" DataKeyField="Customer_Product" DataSourceID="SqlDataSource2" onupdatecommand="DataList1_UpdateCommand" oneditcommand="DataList1_EditCommand1" ondeletecommand="DataList1_DeleteCommand" oncancelcommand="DataList1_CancelCommand1"> <HeaderTemplate> <table border="solid 1px black"> <tr> <th style="width: 250px"> </th> <th style="width: 400px"> Item Description </th> <th style="width: 100px"> Price </th> <th style="width: 100px"> Qty … | |
i put a code in my website to redirect user to paypal sandbox , after entering his email id , and storing it in session , in return url of paypal sandbox i mentioned a page but it doesn't work, it doesn't maintaing the session variable, it assigns null to … | |
my aspx code <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" > <ItemTemplate> Product_Image: <asp:Label ID="Product_ImageLabel" runat="server" Text='<%# Eval("Product_Image") %>' /> <br /> Item_Description: <asp:Label ID="Item_DescriptionLabel" runat="server" Text='<%# Eval("Item_Description") %>' /> <br /> Price: <asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price") %>' /> <br /> Qty: <asp:Label ID="QtyLabel" runat="server" Text='<%# Eval("Qty") %>' /> <br … | |
Hi Everyone, I've been looking for good javascript projects to join. Are there any projects you can advice? I've researched a lot. (with the help of Google. :D) But would also love to get advices from people who have/had worked at an opensource project here. I would also love to … | |
in this when i updated data then not updated it is deleted in update button but there is update fuction how i solve this problem that data are update????/ here is updated fuction { string constring = @"Data Source=.\SQLEXPRESS;Database=htm;Integrated Security=True"; SqlConnection con = new SqlConnection(constring); con.Open(); DataTable dt = new … | |
Hi there, I have been trying solve my error at this codes, it takes me too long. Code: Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim conn As New MySqlConnection Dim myCommand As New MySqlCommand Dim comm As String Dim myconnstring As String Dim UserID … | |
I need some help to make a order form in C#. My development environment is: Microsoft Visual Studio 2010 Ultimate SQL Server Express Edition 2005 Programming Language C# Sample Database = NorthWind (Tables Orders and OrderDetails) I've create a form for order entry, which contain a textbox for OrderID, a … | |
I am trying to connect to db2, but there is an error "system.data.oledb.oledbexception unspecified error" and highlighted the line conn.Open() . I want to know what are the prerequisites for the connection. Or simply my code is doing wrong??? Thank you for any help. Dim Source As String Source = … | |
i hve reservation form add function and add button public void addreserve() { string constring = @"Data Source=.\SQLEXPRESS;Database=htm;Integrated Security=True"; SqlConnection con = new SqlConnection(constring); con.Open(); DataTable dt = new DataTable(); SqlCommand com = new SqlCommand("insertreserveinfo", con); com.CommandType = CommandType.StoredProcedure; com.Parameters.Add(new SqlParameter("@Reservation_id", myreserv.Reservation_ID1)); com.Parameters.Add(new SqlParameter("@Guest_id", myreserv.Guest_name)); com.Parameters.Add(new SqlParameter("@Room_ID", myreserv.Room_no)); com.Parameters.Add(new SqlParameter("@Service_ID", … | |
i have a form whcih is room and in this there is when i add a data on it that is room id,room no and service type and room type then when i add the data like as room id=1 room no=2 room type=double service type=luxury then when i again … | |
Hi I'm using a simple insert statemnt in from two textfield into my database using this code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If (TextBox1.Text.Trim = "") Then MessageBox.Show("PLEASE DO NOT USE BLANK SPACES", "Data Entry Error") ElseIf (TextBox2.Text.Trim = "") Then MessageBox.Show("PLEASE DO … | |
**********************************please see the image first link given below********************************* I have made a crystal report to assign a database to it i created a module with following code and added this module to my form Imports System.Data.SqlClient Imports System.Data.Sql Module Module1 Public acscmd As New SqlCommand Public acsconn As New SqlConnection … | |
I wrote a C# code called parent. When i run the program and try to add parent details to the database( microsoft access 2010), it gives me this error: Exception in DBHandlerSystem.Data.OleDb.OleDbException (0x80040E14): Syntax error in INSERT INTO statement. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) … | |
The idea would be to read the items of Listbox1 (one-by-one) and run a query (Listbox1 ->Field1) and display the result (Field2 -> Listbox3) in the same Listbox3. For some reason, only appears in Listbox3 the result of the last item of Listbox1. Dim con As New OleDb.OleDbConnection … | |
hi, can anyone please check why im getting dataype mismatch error... im using combobox and msaccess db which consist of formNo(autonumber) LastName FirstName MiddleName Address (text) ... if i use address as valuemember there is no error,, but if i use FormNo as valuemember then there this datatype mismatch error.. … | |
Hi, i am relatively new to programming. i am trying to use an open source library found by google search. the readme file tells to write make on commandline, as a result i got an exe file sample, but now i am trying to chk the output and the usage … | |
My professor asks me to program the Game Of Life with some required and I find unnecessary classes. But anyhow as I am coding and running the program midway I run into this problem void Life::setup_grid() { cout << "Size of Grid: " << grid.size() << endl; cout << "rows: … | |
hi all store procedure set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[insertguestinfo] @Guest_ID int, @first_name nvarchar(50), @Last_name nvarchar(50), @Gender_ID int, @Martial_ID int, @Phone_number int, @email_address nvarchar(50) as begin insert into GuestInfo(Guest_ID,First_name,Last_name,Gender_ID,Martial_ID,Phone_number,Email_address) values(@Guest_ID,@first_name,@Last_name,@Gender_id,@Martial_id,@Phone_number,@email_address) END public void add() { Guest_info gst_info=new Guest_info(); string ConString = @"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=htm;Integrated Security=True"; SqlConnection … | |
Hi, Im new in VB.Net. im having trouble with filling the datagridview with data. the program seems to skip the part where i declare the **datagridview datasouce** and only executes until **da.fill(dt)**. here is my code, hope you could help me. thanks in advance. Imports System.Data.SqlClient Public Class Form1 Dim … | |
I have one form having One DataList In which i have two table one having Header Template and other having Item Template....... Code Of aspx page is as follows..... <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"> <HeaderTemplate> <div> <table> <tr> <td style="width:245px; text-align:center;"> Image</td> <td style="width:450px;text-align:center;"> Item Description</td> <td style="width:260px;text-align:center;"> Price</td> <td style="width:322px;text-align:center;"> … | |
Have you got one? A list of things you would like to achieve before you die? mine is: 1/ Write a stunning program that 600 people buy, but 60,00 pirate. 2/ Really know and be fluent in another language (Greek in my case). 3/ Visit Tibet. 4/ Win just enough … | |
![]() | Hi, I have problem with my connection to the database generate from entity data model of Ado.Net Entity framework. I work in Console Application. My code looks like that: public static void Main(string[] args) { string connectionString = "Data Source=(localdb)\v11.0;Initial Catalog=BarDatabase;Integrated Security=True"; using(SqlConnection con = new SqlConnection(connectionString)) { string queryStatement … |
Private Sub cmdAdd_Click() Dim con As ADODB.Connection Set con = New ADODB.Connection Dim rsAdd As ADODB.Recordset Set rsAdd = New ADODB.Recordset Dim Query As String con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Asus\Desktop\VBTHESIS_liel2\ListofMembers.mdb;Persist Security Info=False" con.CursorLocation = adUseClient rsAdd.Open "SELECT * FROM census WHERE ID ='" & strId & "'", con, adOpenStatic, adLockOptimistic 'If textboxes … | |
Dim Cname As String Dim CID As Integer Dim Rmaterial As String con = New OleDbConnection("Provider=Microsoft.ace.Oledb.12.0;Data Source= C:\Users\Lenovo\Documents\Visual Studio 2010\Soft\Database\Login.accdb") con.Open() cmd = New OleDbCommand("select * from Purchase where CompanyID='" & txtnum.Text & "'", con) dr = cmd.ExecuteReader() If txtname.Text = "" And txtnum.Text = "" And txtraw.Text = "" … | |
public partial class TestingDisplay : System.Web.UI.Page { PagedDataSource pds = new PagedDataSource(); protected void Page_Load(object sender, EventArgs e) { /*SqlConnection conCart; SqlCommand cmdSelectCount; conCart = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionNWind"].ConnectionString); conCart.Open(); cmdSelectCount = new SqlCommand("Select Count(*) From ProductDetails Where CategoryCode = @category", conCart); cmdSelectCount.Parameters.AddWithValue("@category", ddlCategory.SelectedItem.Value.ToString()); var countStart = (Int32)cmdSelectCount.ExecuteScalar(); lblCount.Text = countStart.ToString();*/ /*if … | |
hi all now guyz i add a info in datagrid view also displau now i hve some probelms that when i create a update fuction in guestinfo table then the guest_id is autogenerte then can i delete through guest_id or not and it is also not updated public void update() … | |
Hello guys im in need of a help. I have a checkbox on a Listview1 and i also have listview2, textbox and 2 buttons. On listview1, i have a list of items and its subitems. Then im going to put a check on the one of the listview item then … | |
[I]Personal:[/I] [B]Name[/B] -Dheeraj Suthar aka sherkhan [B]Hair[/B] - dark brown [B]Eyes[/B] - 2 of 'em [B]Location[/B] - India [B]Hobbies[/B] - Computers, Games(FPS and strategy) [B]Favourite Music[/B] - Kitaro Rammstein .. [B]Favourite Movies[/B] - Matrix I, Godfather, Hackers Operation Takedown, Mist [B]Favourite TV Shows[/B] - Family guy, Friends [B]Stuff I Dislike[/B] … | |
** Please help me debug the code, I am experiencing error in this part: cmd.CommandText = "select ROUND(((date_from - date_to)/30),0) as months from rental where tenant_id = '" & Me.TextBox9.Text & "'" cmd.CommandType = CommandType.Text It says: Error while retriving record on the table.. There is already an open Data … | |
I am having trouble getting the codebehind to execute properly. I am new to c#.net, what I have is a web-based log in form that when the user enters their username and Id it will check against ms access to verify the username and password. I am getting this error … | |
Hi, I am experiencing irritating error (undiscriptive rather), when I want to insert a single statement into my db. Following is the code: protected void Button1_Click(object sender, EventArgs e) { SqlConnection dataConnection = new SqlConnection(); dataConnection.ConnectionString =@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"; SqlCommand dataCommand = new SqlCommand(); dataCommand.CommandText=("INSERT INTO citylist(city_id,city_name,latitude,longitude,state) VALUES ((1, … | |
Hello, I currently am running a gameing server and found some php code to send RCON commands to my game server. I am completly new to PHP, but not new to code. I would appreceate if someone could fix these 2 lines of code. On my XAMPP server I have … ![]() | |
Hey Guys, I'm an A level student studdying Computer science, and hence using VB.NET for my coursework. Therefore I'm very novice at VB! While trying to update Data in a Microsoft Office, Access table (Office 2010) - I get this error. (In VB) Bare in mind, I've read all this … | |
hi all i make a store procdeure in visual studio wpf when i run a code the error is not solve here is error "Procedure getguestinfo has no parameters and arguments were supplied." and here is the code public class guests { private int guest_id; public int Guest_id { get … | |
Private Sub btnInsert_Click(sender As System.Object, e As System.EventArgs) Handles btnInsert.Click Dim con As New OleDbConnection Dim cmd As New OleDbCommand Dim dr As OleDbDataReader Dim Pnum As Integer Dim InDate As Date Dim PDate As Date Dim Amount As Integer Dim CmpID As Integer Dim Tax As Integer Dim TaxAmt … | |
i want to get the alert on responce text, but getting nothing, my code is as follow, [ICODE] <?php session_start(); ?> <script type="text/javascript"> var xmlHttp function checkCAP(str) { if (str=="") { alert("plase enter the code"); return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } … | |
hi it 's working but the Grid view not disp.lay the details Dim cn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;" & "Data Source=D:\Task_one_one\TaskNew\TaskNew\App_Data\db1.mdb") cn.Open() Try Dim myTable As DataTable = New DataTable("MyTable") 'Dim ds As DataSet = New DataSet myTable.Columns.Add(New DataColumn("Emp Id")) myTable.Columns.Add(New DataColumn("Start Time")) myTable.Columns.Add(New DataColumn("End Time")) myTable.Columns.Add(New DataColumn("Hours")) myTable.Columns.Add(New … | |
I found a tutorial online that so far has been aswesome. I downloaded the access db and so far can read and browse through it. However, when I try to write back to it (btnSubmit_Click), nothing happens. All other buttons work fine, I can still browse, and I get absolutely … | |
I'm trying to add a file uploader to my website and I was wondering if there is any way or any open source code that can upload a file and the display the contents of the file in an html textarea. This files with most likey be Python or Javascript … |
The End.