9,022 Topics
How to select records with today's event? I have a column that is set to smalldatetime. I need to select those that have a row of today's event.
[code] Dim Conn_web As SqlConnection Conn_web = MyFormz.connec.ConnWeb2(dbName) Conn_web.Open() Dim sqlcmd_Insert As New SqlCommand(sql_Insert1 + sql_Insert2, Conn_web) Try sqlcmd_Insert.ExecuteNonQuery() MsgBox("The New Record has been saved.") Catch ex As Exception MsgBox(ex.Message) End Try [/code] [code] Sub Insert_New_Converts_Followups(ByVal strFollowup_No As String, ByVal strFollowup_Date As String, ByVal strFollowup_By As String, ByVal strFollowup_Response As …
I read an article about versatile webcam and I successfully worked it out. The thing is I can't save the image from the pictureBoxDisplay to SQL. Please I really need help on this. I'm converting the pictureBox into a byte array but there's an error in this line (line 123), …
Following is the code i used for exporting crystal report on to a pdf file on a buttonclick.The back end used is sqlserver2005 .The problem am facing is the whole records in the database is showing instead of the single record i've been searching for [COLOR="Green"]System.IO.FileStream fs = null; long …
Hi.. I want to take the max value of the substring of a varchar field having values as SN1,SN2....SN10.I used the query as following [CODE]select max(substring(st_no,3,4)) from tbl_st;[/CODE] I am getting the max value as 9.I want to get 10. If somebody knows please help me
Hi to all, I created following table --------------------------------------------------------------------------- create table Interiors(no integer, name varchar, type varchar, dateofstock datetime, price decimal(6,3), discount numeric(6,2)) ----------------------------------------------------------------------------- i want to solve these two queries. 1. Display the type, sum of price and average of discount by grouping type as 'baby cot'. 2. Display the …
Hi to all, i created following table ------------------------------------- create table employee(name varchar(20), dob datetime) ------------------------------------- I want to extract names of all months from 'dob'. for that i wrote following query ------------------------------------- select datepart(month, dob) from employee -------------------------------------- it works and shows all months but in number format, i want …
Hi, am SQL beginner, now i trying to code student marks management so i came across to db i was confused. Please give idea to create such thing, i have students, mark tables as per the semester. then how i place the information according to register number. so that how …
How do you replace characters as in an update? Example I have an address field that contains '.' and '-' and I need to remove these characters. Anyone know of an update script to do so?
I have a set of code that builds a table as the user enters information. This information may be changed more than once before it is considered complete. After the user is done, I want them to click a button, and have that information entered into the SQL database where …
i got this error i already checked my table definition [CODE] Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click da.InsertCommand = New SqlCommand("INSERT INTO AdmissionRecord VALUES(@Patient_ID, @Patient_Type, @LName)", cs) da.InsertCommand.Parameters.Add("@Patient_ID", SqlDbType.VarChar).Value = Txtpatient_id.Text da.InsertCommand.Parameters.Add("@Case_Number", SqlDbType.VarChar).Value = txtCaseNumber.Text da.InsertCommand.Parameters.Add("@Patient_Type", SqlDbType.VarChar).Value = IIf(String.IsNullOrEmpty(cboxpatient_Type.Text), DBNull.Value, cboxpatient_Type.Text) da.InsertCommand.Parameters.Add("@LName", SqlDbType.VarChar).Value = …
Hello Guys, My problem is When i'm trying to run this program Sql QUERY doesn't work properly , but the month and day are okay but it comes to year it doesn't work... :( anybody can help me please? thanks [CODE] Dim strSql As String = "SELECT * FROM tblAudit …
Hi guys, In C# when i use the using statement. in case of try catch do i have to close the connection in case of any error. [CODE] try { using (connect=connecttodabase()) { SqlParameter demo_ID = new SqlParameter(); SqlCommand command = new SqlCommand("Demo", connect); command.Parameters.Add(demo_ID); int rowsAffected = command.ExecuteNonQuery(); return …
Hello! I wonder if someone can help me. I have a combobox named Requirements and The values of it come from sql. I want to ask how can I detect if I already selected one item to avoid selecting it again the next time I dropdown the combo box. Thank …
please people your help will be appreciated. i have a table with data definition: column Datatype BookID int AuthorFirstname nvarchar(20) AuthorSecondName nvarchar(20) BookTitle nvarchar(50) Price nvarchar(50) My problem is that i can't see the inserted data in my table Below is the whole code: [CODE]Imports System Imports System.Collections Imports System.ComponentModel …
Hello Guys, My problem is i don't know how to query TOP ORDER PROD using COUNT,AVG... anybody can help me please? thanks ^_^ [CODE] EXAMPLE -LIST OF ORDER'S- ITEM CODE | ITEM NAME | 4323 PROD A 4323 PROD A 4323 PROD A 4323 PROD A 4323 PROD A 2345 …
Hi Everyone, I'm doing a point of sale application and would like to add code to my "Save" button that will insert data into the database. The form will first lookup a customer and set up data for an invoice header. The customer will be able to select products and …
hey guys i get this error when trying to execute a stored procedure in my SQl DB [CODE] Warning: mssql_query() [function.mssql-query]: message: SELECT failed because the following SET options have incorrect settings: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed …
i have a project, where i have a menu, in which option Customer info, where all the basic information of customer is stored...and blow there is another menu, whre Asset Servey is menu, now i have a text box in wch customer with its code is shown, now i want …
Hi there guys really hoping for some help after searching Google for a stupidly long amount time and coming up blank. I am using Crystal Reports 10, Asp.net 1.1, SQL Server and Visual Studio 2003 with VB. I have an Image field in the database that I need to retrieve …
Here is sample tables [B]Case[/B] Case_ID AC_ID ASSET_ID [B]Action[/B] Action_ID Case_ID Step_No Date_Started Date_Completed Status [B]Procedure[/B] P_ID Step_No Name AU_ID AC_ID 1 1 Step1a 1 1 2 2 Step2b 1 1 3 3 Step3c 1 1 4 1 Step1a 2 1 5 2 Step2b 2 1 6 3 Step1c 2 …
I need help troubleshooting a performance issue. I have a stored procedure that is selecting from 3 joined tables, and is hanging on the first time this procedure is running. Sometimes hanging so long that I get a timeout error. After the first run, it's faster, but still takes longer …
Hi my problem is that so I can't add new data to database. I wrote procedure in mssql 2008 and now i don't now how coneecting this with asp.net [code] Create procedure [dbo].[addData] @name nvarchar(50), @telephone int, @place nvarchar(50), @street nvarchar(50) AS Declare @person_id int, @place_id int BEGIN if not …
Hello there i am having trouble on how to compare the password of the input and the one in the DB since the one in the DB is encrypted with the code below for registration i just used a stored procedure in the db and called it in the php …
Sum of One and not the Other I have a requirement to query one figure and the sum of another. What I need is one query to produce the MonthPayment for each CompanyID for a given ContractID and the Sum of TotalPayment with matching CompanyID and ParentCompanyID for each CompanyID …
I know sql provides us with LTRIM and RTRIM but is there anyway to remove the spacing in the middle. '123 Johnson St' should be '123 Johnson St. Anyone know of any functions or tricks?
Hi Guys, Can anybody spot the error on this code? it gives me error: SQL Server Database Error: Incorrect syntax near the keyword 'inner'. 5 0 [CODE]Select e.event_number,e.start_date ,event_desc, venue_desc,s.location from events e inner join venues v on v.venue=e.venue inner join sessions s on s.event_number=e.event_number and session_type='0' (inner join contact_categories …
I made an windows application using c# express edition 2010 and i use the SQL database as mdf file inside my soultion and the connection string mad automaticaly in the app.config as the following: [CODE]<add name="MainForm.Properties.Settings.FamilyHistoryConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\FamilyHistory.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />[/CODE] then when i am trying to publish the …
Hi all, I'm currently make my final year project program at university, and have been puzzled by this problem for sometime now. The issues I am having is that when I try to update a value in a specific column of a specif row. The program has a paddy and …
Hello, I am quite stuck. I have my database running on a seperate machine from where I am writing my application. The connection between Visual Studio and the database seems to be fine as I can display data in various controls on the GUI. My problem arises when I try …
I have written to take Backup of any database automatically, at any time given by the user in config file. It's working fine, now i wish to take the Backup of a certain database which was already taken Backup previously for the next time. Any help.[CODE] private void FrmRestoreBackup_Load(object sender, …
hello all, I have database named 'Marketing', and want to bound DropDownList control with it using 'add connection' dialog box in the C#.net. I gave datasource: 'Microsoft SQL Server Database File (SqlClient)'. And when I give DataBase file name as 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Marketing_Data.MDF', I get error while testing the …
I have written the following code which works fine But the problem is in the database only 3rows from csv file is reflected and rest is not Following is my code Can anyone help me for the same [code] namespace Test1 { public partial class Form1 : Form { public …
Hey people, I have a database that is stored on a remote machine. In my application i have used connection string with IP address of that remote machine. Now, the problem is every time the remote machine is turned on it has a new IP address. Is there any way …
how to connected data base(sql) with c language......? with exampal...?
Guys! im doing a search program where in ill just search the name of the product then print it. [CODE] Private Sub txtSearch_Change() rsTransaction.Close rsTransaction.Open "select * from tblTransaction where mid$(Date,3,2) like '" & txtSearch.Text & "%'", con, 3, 2 end sub [/CODE] it is actually doing fine but i …
MS SQL 5 vb.net asp.net I working on a new site that requires me to show a page with a single product and it's information. I have a Next and previous button that will take the user to the next item in that category / subcategory. basic Querey to show …
Does anyone know if it is possible to modify the maintenance plans through t-sql and if so please provide the code to do so. THANKS!
This is my code. [CODE] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Registration Page</title> </head> <body background= "bg8.jpg" width="1000" height="1000" alt="work1"> <form action="clientlogin.jsp"><table> <tr> <td> Company Name</td><td> <input type="text" name="cname" value="" /></td> </tr> <tr> <td> Password </td><td><input type="password" name="pwd" value="" /></td> </tr> <tr> <td>Location of company </td><td><input type="text" name="location" value="" /></td></tr> …
Hi Everyone, Can you tell me how to fix my query so I can determine if an amount entered into a textbox is < the largest number in a database table? Here is some sample data: [CODE] CategoryNumber ---------------- 10 20 30 40 50 [/CODE] If the user enters 35 …
Part of the void code: [CODE]string sql = "SELECT SUM(monto) As TOTALM from meses where status='ACTIVO' and mesactual= '" + vMes.ToString() + "' and ano= '" + vAno.ToString() + "'"; dtm = new OleDbDataAdapter("Select * from meses order by nombre", con); oCM = new OleDbCommandBuilder(dtm); OleDbCommand cmd = new OleDbCommand(sql, …
Hi, I am experiencing some abnormal application behavior. I wrote an application in C# that does hourly database , as well as directory backups. Its constructed in a way that all settings are saved in XML file. and once the user allows the application to start doing the scheduled backups, …
I found this script online for full DB backups but I was wondering how to change this to also set differential backups? [CODE]DECLARE @name VARCHAR(50) -- database name DECLARE @path VARCHAR(256) -- path for backup files DECLARE @fileName VARCHAR(256) -- filename for backup DECLARE @fileDate VARCHAR(20) -- used for file …
Hello, I have a table of many rows, and some rows have a connection to other rows. A simplified example of the table I am trying explain is below. ID MYVar LinkedToMYVar 1 10 0 2 20 0 3 30 10 4 40 0 5 50 10 6 60 30 …
Hey! I am creating an application which will allow users to search parents names and display their childen respectively in a datagrid. I have created a form with two text boxes, a search button and a datagrid. The two text boxes are txtFName.text and txtLName.Text. On clicking btnSearch I want …
I am trying to write some queries and I am confused on exactly what to do. Here are my tables that reference my 3 questions. Branch ([U]branch_id[/U], branch_name, street_address, city, state, zipcode, phone, branch_manager, library_id) FK – library_id > library Library ([U]library_id[/U], library_name, street_address, city, state, zipcode, phone, manager_name) Patron …
i have code to produce a database and tables but now i am looking 4 code 2 add relationships to the tables i would have made [code] Sub Create_ALL_Tables(ByVal dbName As String) Dim sql_Area As String = "CREATE TABLE Area (Category_ID bigint IDENTITY NOT NULL," & _ "Category nvarchar(50) NULL,Area_Name …
Msg 6505, Level 16, State 1, Procedure EmailAudit, Line 1 Could not find Type 'trgmail' in assembly 'ValidateMail'. though i already check that 'trgmail' is already program name still it show me in sql server that 'trgmail' could not find in this assembly
Hi All, I have started making applications that retrieve data from sql databases. I write the database with Sql management studio then apply that database to my applicaton. My question is, how can I make my applications more secure against hackers. Some applications store user names and passwords and personal …
Hello all, I'm using MS Access as my DB for a very simple web site. Everything was running nicely till all of a sudden I can't inset rows into any table in my MS Access database. In my tests I even created a fresh and clean table1 with one number …
The End.