9,022 Topics

Member Avatar for
Member Avatar for korathualex

How to convert date format to dd/MM/yyyy in Linq to Sql select Query I tried as below: DataTable dt = Common.dc.TblMaintenances.Where(a => a.ContractId == Id && a.IsScheduled == true || a.IsScheduled == false).OrderBy(a => a.ScheduledDate).Select(a => new { a.MaintenanceId, a.MaintenanceDate.ToString("dd.MM.yy"), a.MaintenancePerson,a.Remarks,a.ScheduledDate,a.IsScheduled,a.Cost }).getDataTable(); But didn't work

Member Avatar for pixelsoul
0
1K
Member Avatar for preston326

Hello, Im currently studying for Database Administration Fundamentals exam. I have bought Microsoft's official book but its really poor. At the end of every topic there is a test but there are no answers to those questions. Therefore, could someone go through my test and check it. https://docs.google.com/file/d/0B503TtEQXNHiX1U1UWVFdEZETUE/edit?usp=sharing https://docs.google.com/file/d/0B503TtEQXNHiMjhwTnZ2MVllZHM/edit?usp=sharing Thank …

Member Avatar for RvSon
0
103
Member Avatar for Papa_Don

Hello Group, I'm beginning to understand the connections required to return information from your database. I'm now trying to return multiple lines from the database that have the same "prefix" within the part number. As my example, I have two records within my database that both start with "AO0025". I …

Member Avatar for Papa_Don
0
239
Member Avatar for akkbkht

Hello. I am going to create a website for a hospital where I will store the following data; * Patients Data * Physicians Data * Medicine Data If I am going perfect then first of all I will have to create a database in SQL Server. Then Tables (Patient, Physicians …

Member Avatar for akkbkht
0
910
Member Avatar for Papa_Don

I'm trying to read and return info from an SQL database. To ensure you have the details, here's the basic info: The database is called "DataDesignSolution" The table is called "INVENTORY" I'm trying to read the columns "INV-PART-NUMBER" and "INV-DESCRIPTION". I've written the following code hoping to SEARCH through the …

Member Avatar for Papa_Don
0
168
Member Avatar for AmrMohammed

Greetings I have the following question. I'm designing a new database for a human resource application. I will construct a table for employee information is it good to separate the employee information to 2 tables one for personal information and the other one for work data such as the salary, …

Member Avatar for IIM
0
110
Member Avatar for bantex07

here is may code the error is .ExecuteNonQuery() thx for helping Imports System.Data.OleDb Public Class registration Private Sub registration_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim connectionstring As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|datadirectory|\db1.accdb; persist security info = false" conn.ConnectionString = connectionstring If conn.State = ConnectionState.Closed Then MsgBox("open") Else …

Member Avatar for Reverend Jim
0
273
Member Avatar for Papa_Don

Group, I'm discovering that the SQL Server tables don't like identical (in this case) Part Numbers, even though one of the columns will have different information in it (in this instance, it is the "Location"). FYI.... I'm using SQL Server 2008 Express for my testing. With this said, I'm trying …

Member Avatar for Papa_Don
0
384
Member Avatar for saat.kerkuklu

Hello guys i have a question i have these codes Imports System.Data Imports System.Data.SqlClient Module Connect Public Conn As SqlConnection Public Function GetConnect() Conn = New SqlConnection("Server = SQL Server;" & "initial Catalog = BloodBank;" & " Trusted_Connection=yes") Return Conn End Function End Module Public Class BloodDonor Private Sub TextBox5_TextChanged(ByVal …

Member Avatar for saat.kerkuklu
0
983
Member Avatar for pearl.kumar1

Hi, IF I run my application was created in vb.net, it Shows an error like "Incorrect syntax near '3/15/2013 12:00:00 AM'." I neeed to Display the data in Gridview Based on date.. The code is Private Sub File_Request_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Form1.Visible = False …

Member Avatar for Reverend Jim
0
638
Member Avatar for Fahhad

USE [Emp1] GO CREATE FUNCTION [dbo].[Leave] ( @EmployeeID INT ) RETURNS INT AS BEGIN DECLARE @PayLeave INT, @NonPayLeave INT; SET @PayLeave = 0; SET @NonPayLeave = 0; RETURN ( SELECT IF((ImDescription == "Sick") AND (ImLeaveType == "Yearly")) { IF((ImMonthlyMaxLeave > 1) OR (ImYearlyMaxLeave > 10 )) { @NonPayLeave = @NonPayLeave …

Member Avatar for adam_k
0
316
Member Avatar for korathualex
Member Avatar for pritaeas
0
96
Member Avatar for chdboy

Hi, I'm adding day shift column where current month (I'm using datetimepicker for extracting month from it ) but getting this error Conversion failed when converting date and/or time from character string Here is the code Dim str10 As String = "Select COUNT(DayShift) FROM Attendance WHERE AttendanceStatus = 6 AND …

Member Avatar for chdboy
0
133
Member Avatar for Papa_Don

I'm trying to use the Import/Export Wizard to import data from an Excel File to the SQL Database. First, know that I'm trying to run it as an "Administrator". I've had issues because it wouldn't let me log in. So I'm trying it this way. I'm following the steps as …

Member Avatar for Papa_Don
0
277
Member Avatar for while(!success)

Hi guys, I'm hoping you can help me find a more elegant solution to my query inside a foreach loop. Here is the loop in question: foreach (DataRow row in dt_blah.Rows) { SqlCommand sc = con.CreateCommand(); sc.CommandType = CommandType.Text; sc.CommandText = "select blah blah blah .. where S = @s1 …

Member Avatar for AleMonteiro
0
1K
Member Avatar for AmrMohammed

Greetings, I want to know what is the best practices when setting new database options? which options I should switch them from False to True and vice versa

Member Avatar for pritaeas
0
231
Member Avatar for vuyiswamb

Good Day i have been hit by this error this night. I have a UDF defined like this CREATE FUNCTION [dbo].[funcFormatPercentages_Extended_numeric] ( -- Add the parameters for the function here @parPercentageToBeFormatted nvarchar(20) ) RETURNS nvarchar(20) AS BEGIN RETURN CAST(CAST(convert(float,@parPercentageToBeFormatted)* 100 AS decimal(4, 1)) AS nvarchar(5)) + N'%' END so i …

Member Avatar for pritaeas
0
1K
Member Avatar for GTTravis

Hi guys, I am attempting to build a asp.net page that will allow users to upload multiple photos, view them in a gallery and remove them if necessary. Details Photo Upload Part >> Users will be able to select multiple images of varying types (png, gif,jpg) from any location on …

Member Avatar for pritaeas
0
149
Member Avatar for Papa_Don

Here we go again. I've installed SQL Server 2008. I can't seem to find my database I've created (and there are two tables so far) that were created through Visual Studio 2010 Express (I'm coding in VB). If it helps, I've determined that the database is a ".Net Framework Data …

Member Avatar for Papa_Don
0
218
Member Avatar for Papa_Don

Hi group, After reviewing notes, I think I understand how to write the code to save data in the SQL Server. With that said, I want to understand the best way to arrange the data and upload it. My project is creating an order. I'll have the usual part number, …

Member Avatar for Papa_Don
0
145
Member Avatar for maryam_89

Basically, I am wanting to get the last userID which is submitted when the user enters their details and clicks the submit button. I have searched the internet and have made changes but still don't understand where i'm going wrong. I used the MAX statement to show the last user …

Member Avatar for JorgeM
0
248
Member Avatar for HunainHafeez

need an insert query for my code , i wrote code to add table rows having textboxes, dynamically, e.g yoh have only passed HSSC exam then you have to fill 2 levels of education SSC, HSSC......or say you have passed Phd , then SSC,HSSC,BS, MS, Phd, you have to fill …

Member Avatar for Member #949455
0
308
Member Avatar for manhthaodn

My database with the following table: ITDetail Table: [Click Here](http://i.imgur.com/WcwRI.jpg) InvTrans Table: [Click Here](http://i.imgur.com/hPnlz.jpg) Currency Table: [Click Here](http://i.imgur.com/YUNxC.jpg) Database Relationship: [Click Here](http://i.imgur.com/CTCdo.jpg) I need to build a report with the time parameter (use the procedure; [Click Here](http://i.imgur.com/PwVYX.jpg)) with the following requirements: 1. MaterialID, Art, Color, Width is taken from the …

Member Avatar for Member #949455
0
198
Member Avatar for gs1344

Everyone has been helpful during this learning process, Thanks! I am not even sure this is doable or even how to start the code! Can anyone please point me in the right direction. I have searched everything I can on this but nothing seems to fit what I want to …

Member Avatar for Member #949455
0
209
Member Avatar for Fahhad

I need to pass the @startDate and @endDate as variables to @range in the code given below. But when I execute the below code, I'm getting the Error as follows. What is going wrong in my code, and how can I correct it? Errors: Msg 102, Level 15, State 1, …

Member Avatar for BitBlt
0
259
Member Avatar for cromz

Need some help with this problem. On the following table Supplies Storedlocation Containing the following rows 5 A 2 A 3 B 2 A 2 A 2 A 2 B 2 B Here is my code to display the sum of supplies based on the stored location select sum(supplies) from …

Member Avatar for Reverend Jim
0
161
Member Avatar for prateek29chandra

hi guys am having problem with data binding navigator control. have added data source. here in my case table name is "Event" and table name is "mca1". have set properties of all textboxes nd combo boxes to its repective field. and set bindindNavigator1 binding property to mca1bindingSource. now am getting …

Member Avatar for Ketsuekiame
0
153
Member Avatar for jackmaverick1

When connecting to a database, is it best to use one SqlConnection object for the entire server, or use one for each connection? I couldn't find a good answer in Google, but maybe my Google-fu isn't good enough.

Member Avatar for deceptikon
0
87
Member Avatar for Papa_Don

Group, I may have messed up bad. I need help. I was having trouble loading a database I had created with data. So I downloaded SQL Server 2008 Express that included the management tools. I tried to find and open the created database and never could find it using the …

Member Avatar for Papa_Don
0
253
Member Avatar for help_lucky

Hi All, I wish you a Happy new year!!!.. My requirement is to upload an excel file using PHP and to update the data in MSSQL. For which i have designed a screen so that the user can browse 2 input files and update the database. html code for the …

Member Avatar for helpplss
0
360
Member Avatar for korathualex

Remove the last word while using left in sql query...I weant to avoid broken words while doing so... My query as follows: select top 2 tempJobTitle.id,tempJobTitle.JobRefId,tempJobTitle.JobTitle,LEFT (jobmaster.JobDescription2, 330)+'....' as JobDescription,jobmaster.PostedDate from tempJobTitle inner join jobmaster on jobmaster.JobRefId=tempJobTitle.JobRefId where tempJobTitle.Status='Approved' and jobmaster.ClosingDate >= '2013-03-01' order by tempJobTitle.DateofEntry desc

Member Avatar for adam_k
0
2K
Member Avatar for moone009

I've have been doing some research on how to export export a pipe delimiated file from sql management studio but I cannot quite seem to figure it out. How would I simply turn this output into a piped file. [CODE]select * from #tmpRPLRouting where propertydatamap = '3' [/CODE]

Member Avatar for hrothenb
0
138
Member Avatar for sundog1

Good morning Guys, I've got this code currently running: private void button1_Click(object sender, EventArgs e) { SqlDataSourceEnumerator sdse = SqlDataSourceEnumerator.Instance; DataTable table = sdse.GetDataSources(); foreach (DataRow row in table.Rows) { instanceCombobox.Items.Add(row["ServerName"].ToString() + "\\" + row["InstanceName"].ToString()); } Which gives me the Instance and Name of the SQL Server over the Network. …

Member Avatar for TnTinMN
0
238
Member Avatar for rpv_sen

Hi Friends i am working for association management project. my database is mssql i am having 2 tables as below **1. table name is community_username** ASCN_NAME COM_NAME URFNAM Email_id URAC Name1 Commname1 Name1 Email1 Yes Name1 Commname1 Name2 Email2 Yes Name1 Commname1 Name3 Email3 Yes Name2 Commname1 Name1 Email1 Yes …

Member Avatar for rpv_sen
0
201
Member Avatar for dualzNZ

Hi all I am currently working on a Battlefield player / server statistics application that i have written in C#. I am storing RAW player / server data in a table at the moment. My question is what is a recommended maximum columns per table as this statistical data which …

Member Avatar for pritaeas
0
239
Member Avatar for subtlehulk

Hi, I have a problem with a code harness given to me by my tutor. Every time i enter values into a form, I get the following message: > Warning: mssql_query(): message: Invalid column name 'N56DSRT'. (severity 16) in /web/users/l1099341/SDD/insertCarController.php on line 27 Warning: mssql_query(): General SQL Server error: Check …

Member Avatar for pixelsoul
0
339
Member Avatar for Kapalua

Hi, I have tried several solutions for my application which lets several users upload files to a database. The users belong to groups and should only be allowed access to their files or the groups files(if 'sharing' is on). I have tried to give every group their own database, but …

Member Avatar for jpcaparas
0
1K
Member Avatar for Papa_Don

Group, Via Visual Studio 2010, I've created a SQL Server database with the appropriate fields, data types, etc. I'm now ready to begin some testing, however I need to put some information in those datafields. I'm having trouble doing this. I DID NOT set the tables to display in the …

Member Avatar for Reverend Jim
0
331
Member Avatar for cyberdaemon

Good day, I am having trouble with the computation in SQL. i want to subtract the intStock and the intTotal_OutBound_items to just to get the items available. here is my SP.. INSERT INTO CO09_Report ( intMaterial ,txtDescription ,txtMaterial_Type ,txtATP_check ,intDelivering_Plant ,intOrder_Quantity ,isHeld_by_Finance ,isRejected_OOS ,isRejected_Others ,intOpen_Order_Quantity ,intOrder_Quantity_NKA ,intOrder_Quantity_RKA ,intOrder_Quantity_Others ,intStock ,intDSD_Delivery …

Member Avatar for pritaeas
0
217
Member Avatar for verbalurbs

Hello I am trying to display an ID which is a primary key in my table by selecting the corresponding name in my table. the names have been saved in a combo box and depending on the name selected the textbox will display that Id. the code I have so …

Member Avatar for martinhosking
0
430
Member Avatar for slygoth

Hello I am trying to insert some data into a sql server i have but it seems like I'm formating the information wrong. This is what i have so far. product id = int; type = string; watt = float; volts = float; String query = "INSERT INTO GoodCustomer(Product ID, …

Member Avatar for bguild
0
173
Member Avatar for sukhanya

I have 'bit' datatype in db. I convert its equivalent datatype to 'bool' in c# when i declare. protected bool e_Status; And when I set the property for the above, public bool Status { get { return e_Status; } set { e_Status = value; } } Now how do I …

Member Avatar for sukhanya
0
944
Member Avatar for anayo.anaeligbo

Hello, i installed MS SQL Server 2008 0n a stand alone/member server runing windows server 2003 R2. I connencted it as a member server to a Domain Controller(child1.parent.local) in another site. This worked very fine both the replications were succecssful. The domain controller which i connected to, is a child …

Member Avatar for JorgeM
0
108
Member Avatar for chdboy

CODE: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Danial\documents\visual studio 2010\Projects\ESI_PF_Payroll_V1\ESI_PF_Payroll_V1\Pay.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True") Dim adaptor As New SqlDataAdapter Dim dataset As New DataSet con.Open() con.Close() con.Open() cmd = New SqlCommand(str, con) cmd.Connection = con cmd.CommandText = "SELECT Firstname FROM …

Member Avatar for chdboy
0
184
Member Avatar for rahul pareek

hello there I m trying to do database connectivity with sqlserver2000 it runs if i write that code in a normal java file but if i run that code with jsp file it gives an exception com.microsoft.jdbc.sqlserver.SQLServerDriver Although i hav set the CLASSPATH of Jar file for sqlserver 2000 here …

Member Avatar for rahul pareek
0
149
Member Avatar for rahul pareek

How to fetch comma seperated values(csv) from a field in sqlserver2000

Member Avatar for cyberdaemon
0
115
Member Avatar for OnlineD

I have just about reached the limits of my knowledge with a SQL statement that I am trying to write that pulls in data from multiple tables. Basically I have a situation where I have a Fund in one currency and a Share class in another currency. Investments are made …

Member Avatar for cyberdaemon
0
192
Member Avatar for slpefanis

Hi All, i am not sure if this is the right forum, but i couldnt find a SQL section. I am writing an application to log data from our PLC system to a SQL database. I would like to write a record every second. I have it all working fine, …

Member Avatar for Reverend Jim
0
149
Member Avatar for rahul pareek

ResultSet rs=st.executeQuery("select * from category"); rs.moveToInsertRow(); rs.updateString("cname",c); rs.insertRow(); rs.moveToCurrentRow(); i want to insert new row in table of sqlserver2000 database the row should insert at last in a table .can i use variable at place of value in updateString("column name","value") the code i m using is here

Member Avatar for Member #949455
0
97
Member Avatar for kamil.metkowski

Hi I am trying to make a bike shop for my project and i need to pull out a product details with image from sql databse. I have made a table with products and i have stored the images url but i have no idea how to pull it out …

Member Avatar for EvolutionFallen
0
646

The End.