Hi guys, This is my first post and so glad to start sharing the knowledge. I am using Mysql database with VB.NET and I have this code : Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim str As String = "Server=localhost;Port=3306;Database=testdb;Uid=root;Pwd=password" Using con As New MySqlConnection(str) Dim query As String = "select * from testdata where rfid_tag='" & TextBox3.Text & "' and Date_serve<= '" & Date.Now.ToString("yyyy-MM-dd ") & "' and Start_Time<= '" & Date.Now.ToString("HH:mm:ss ") & "' and End_Time>= '" & Date.Now.ToString("HH:mm:ss ") & "' or amount_serve='' " Dim cm As New MySqlCommand(query, con) con.Open() Dim rd …

Member Avatar
Member Avatar
+1 forum 2

Previously used winXP operating system running normally (very good) when switching to win7 operating system, this error, read errors from the SQL Server data, what is the error ? http://www.mediafire.com/view/4q5ux6e66ds4avb/ErrorOpenSQL.jpg/file

Member Avatar
Member Avatar
+0 forum 1

Hi to all! I'm fairly new to using High availability group and i've been having issues with storage space from my Logs drive from my primary server.. I just want to know why is my Log file not shrinking after I do backups(Full) on the primary server.. also, another question.. can I do the backup on my secondary server before shrinking my Logs on the primary? the reason I want to do this because my primary server has a database primarily used for Production(MES) and I don't want any downtime on their part.. Thanks in Advance.

Member Avatar
Member Avatar
+0 forum 4

Hi I need your help with regards on my trigger in sql server update. Want I wanted to do is to update the existing record in my database and then fire this trigger: USE [DB004] ALTER trigger [dbo].[trg_Updt_Item_Code] ON [DB004].[dbo].[RMIS_Item_Master_Ref] FOR UPDATE AS declare @trgDT as datetime declare @trgUser as varchar(20) declare @trgItemCode_new as varchar(50) declare @trgItemCode_old as varchar(50) set @trgDT = (select GETDATE()) set @trgUser = (select i.EntBy from inserted i) begin update RMIS_Item_Master_Ref set ItemCode =(select i.ItemCode FROM inserted i) where ItemCode = (select d.ItemCode FROM deleted d) end currently the output that i get is (0 row(s) …

Member Avatar
+0 forum 0

Dear Friends, i Developed a C# Project with SQL Server Database (Database is not LocalDB) and i want to create a setup file to install on client system havin windows xp 32bit. Please suggest me how to do it ?

Member Avatar
Member Avatar
+0 forum 9

Hello Dear Friends, I need some help to check avilidity of the username on Leave event of a textbox in Database SQL Server, but i cann't get. it code is bellow private void textBox6_Leave(object sender, EventArgs e) { cmd = new SqlCommand("SELECT * FROM usertab WHERE username='"+textBox6.text+"'",con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); int i = ds.Tables[0].Rows.Count; if (i > 0) { label21.Text = "username is already exists"; ds.Clear(); } else { label21.Text = "username is available"; } } con Connetion and DataSet=ds are defined in public section. SqlConnection con = new SqlConnection("data source=MUHAMMAD\\SQLEXPRESS; database = MMS; integrated security = …

Member Avatar
Member Avatar
+0 forum 1

I have Post code column and I want to get 60, 30 and 10% for each area code that I have, but the thing is there is a between statement which makes things a bit complicated. I need 60% from the first postcode then 30% from the second and 10% from the last postcode i.e these are the people I am trying to pull from each postcode. Here is my code below: SELECT top 50000 id ,email FROM fn_getsacilist ('knowblet,saciprofiled,govdata,tobydata',25000000,10,0) WHERE idnumber>='66' and idnumber<='98' and (postcode between 2000 and 2199 or postcode between 4000 and 4099 or postcode between 7400 …

Member Avatar
Member Avatar
+0 forum 3

Hi Guys, I need your help to create query dynamically, how to populate data value from formula in other table. Sample Below Table A ID Amount 1 50 2 40 3 50 Table B ID FormulaID VALUE X 1+2+3 Y 1-2+3 Result Expectation ID FormulaID VALUE X 1+2+3 140 Y 1-2+3 60 Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to get the the number of rows that are populated in a SQL Server table. I am using the code below but it only counts one row everytime when I know in fact that there are 47 row in a particular table. Could someone please point out what I am doing wrong? Regards, Dim connetionString As String Dim connection As SqlConnection Dim command As SqlCommand Dim adapter As New SqlDataAdapter Dim ds As New DataSet Dim sql As String connetionString = ("SERVER=x.x.x.x;database=ITDatabase;trusted_connection=yes;") sql = ("SELECT COUNT(*)FROM ASSETINFO;") connection = New SqlConnection(connetionString) Try connection.Open() command = New …

Member Avatar
Member Avatar
+0 forum 2

I am importing data from excel into datagridview its kind of working fine. my data is like this in excel 10001 MR NEW 10002 MR OLD 10003 MR CLEAN 1MB21 MR DIRTY 1BA12 MR DIXON 1EA12 MR RYDER When I load the data all is loaded untill it gets to the Alpha numeric data 10001 MR NEW 10002 MR OLD 10003 MR CLEAN blank MR DIRTY blank MR DIXON blank MR RYDER Dim MyConnection As System.Data.OleDb.OleDbConnection Dim DtSet As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='I:\Sales Analysis\Vecta\vecta customersmb.xls';Extended Properties=Excel 8.0;") MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [vecta …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a filestream enabled DB and a table to store the files. Until now i used to get the path of the file that has to be saved to DB. But due to some changes this was changed and now i get a byte array. my question here is 1. Can this be done? (if yes, then how? Note: the present implementation is a stored procedure that will get the path) 2. Does this implementation have any advantages - performance wise?

Member Avatar
Member Avatar
+0 forum 2

what is the best way to save data from multiple checkboxes ?? if i have 50 , 60 checkboxes Is it reasonable to set up a column of 50 or 60 checkboxes for ┘Źsaving value for each question separately ? and presumably there are questions that have not responded what should i do ?? <div class="form-group"> <div class="form-group"> <label class="control-label"> Moderate </label> <asp:CheckBox ID="CheckBox2" runat="server" class="form-control" /> </div> <div class="form-group"> <label class="control-label"> Heavy </label> <asp:CheckBox ID="CheckBox3" runat="server" class="form-control" /> </div> <div class="form-group"> <label class="control-label"> Y </label> <asp:CheckBox ID="CheckBox4"runat="server" class="form-control" /> </div> <div class="form-group"> <label class="control-label"> N </label> <asp:CheckBox ID="CheckBox5" runat="server" …

Member Avatar
Member Avatar
+0 forum 1

I have a multicolumn listview. There are three button Add, delete and Updata. List is working fine, it add, delete and update list data. But i want to save every row inside listview when i click save button. Bellow is my XAML. <TextBox Canvas.Left="12" Canvas.Top="12" Height="23" Name="textBox1" Width="120" TextChanged="textBox1_TextChanged" KeyDown="textBox1_KeyDown" GotFocus="textBox1_GotFocus" /> <TextBox Canvas.Left="146" Canvas.Top="12" Height="23" Name="textBox2" Width="120" TextChanged="textBox2_TextChanged" GotFocus="textBox2_GotFocus" KeyDown="textBox2_KeyDown" /> <ListView Canvas.Left="12" Canvas.Top="68" Height="183" Name="listView1" Width="253" SelectionChanged="listView1_SelectionChanged" SelectionMode="Single"> <ListView.View> <GridView> <GridViewColumn Header="Col1" Width="150" DisplayMemberBinding="{Binding Col1}"></GridViewColumn> <GridViewColumn Header="Col1" Width="50" DisplayMemberBinding="{Binding Col2}"></GridViewColumn> </GridView> </ListView.View> </ListView> <Button Name="addButton" Canvas.Left="122" Canvas.Top="41" Height="21" Width="69" Click="addButton_Click" IsDefault="True">Add</Button> <Button Name="removeButton" Canvas.Left="197" Canvas.Top="41" Height="21" Width="69" Click="removeButton_Click">Remove</Button> …

Member Avatar
+0 forum 0

I'm using MS SQL 2012 - trying to LEFT JOIN 3 Pivots - but am running into issues within a query variable that I'm not sure how to debug. Each Pivot works on it's own - but the actual Joining is causing the issue. Any help is appreciated. First time using Pivot - so it may be a minor fix. Have been Googling/Trial&Error for a good day and a half without luck. [SQL Fiddle](http://sqlfiddle.com/#!6/1ff77/13) loaded with my code. Thanks in advance! :) ## The Result Columns ## ID | BaseImpact1_Actual | ... | BaseImpactN_Actual | BaseImpact1_Update | ... | BaseImpactN_Update …

Member Avatar
Member Avatar
+0 forum 1

Hi There, This comes under a few forums on DaniWeb, so I've guessed and posted it here... I have two computers, both connected to the internet and running Windows 7 (Home Premium + Professional). One is my main one, the other is one I do not use. If I installed say, SQL Server, on the old machine, is there a way of connecting them together so I can access the databases via C#? Thanks guys, *Matt*

Member Avatar
Member Avatar
+0 forum 8

Hi all , can you pls say how i able to send the email notification alert with the datas getting from Sql server 2008 using windows service . - Thanks in advance

Member Avatar
Member Avatar
+0 forum 5

i installed PHP version5.4.3 SQL server 2008 IIS7 SQLSRV version3.0 Drupal 7 SQLSTATE[42S02]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'watchdog'. This error occurs right after the following during Drupal 7.26 installation (shown in the error report). It hangs at the start of Install Profile: Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteFinished SQLSTATE[42S02]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'watchdog'. Any idea?

Member Avatar
Member Avatar
+0 forum 1

i have written this query to show total working time and overtime of an employee on particular date (if he has came) otherwise it doesn't show record for a person if his INTIME and TIMEOUT are empty but i don't want this now, i want if for a particular date person's INtime and OutTime are empty then put 00:00 in his intime, outtime, totalworkingtime, overtime. e.g. EmplID EmplName ShiftID intime Outtime totalworking overtime dateVisited `0000001 John S001 00:00 00:00 00:00: 00:00 2013-12-01` Query: with times as ( SELECT t1.EmplID , t3.EmplName , min(t1.RecTime) AS InTime , max(t2.RecTime) AS [TimeOut] , …

Member Avatar
Member Avatar
+0 forum 6

I have text file (attached image) i need to loop and get the values (with ellipse shape )into sql table the text file record usually started with (----)

Member Avatar
Member Avatar
+0 forum 3

i am given task to analyze and modify pre written large queries within small time, so please help me understanding it with times as ( SELECT t1.EmplID , t3.EmplName , min(t1.RecTime) AS InTime , max(t2.RecTime) AS [TimeOut] , t1.RecDate AS [DateVisited] FROM AtdRecord t1 INNER JOIN AtdRecord t2 ON t1.EmplID = t2.EmplID AND t1.RecDate = t2.RecDate AND t1.RecTime < t2.RecTime inner join HrEmployee t3 ON t3.EmplID = t1.EmplID group by t1.EmplID , t3.EmplName , t1.RecDate ) SELECT EmplID , EmplName , InTime , [TimeOut] , [DateVisited] , CASE WHEN minpart=0 THEN CAST(hourpart as nvarchar(200))+':00' ELSE CAST((hourpart-1) as nvarchar(200))+':'+ CAST(minpart as …

Member Avatar
Member Avatar
+0 forum 1

i almost spent 3 hours on EXISTS operation, used in SQL especially with subqueries, i got its purpose :) that's ok but what i don't get is that WHY TO USE IT ? e.g. couldn't understand this example: *TABLE STORES* storeName----Sales-------Txn_date *TABLE GEOGRAPHY* regionName----storeName SELECT SUM(Sales) FROM Store_Information WHERE EXISTS (SELECT * FROM Geography WHERE Region_Name = 'West');

Member Avatar
Member Avatar
+0 forum 10

we should create a program that could run through two computers and the computers should be able to access 1 database for record sharing. how can we make that? we already made the system. the problem is, how can we implement this in a networked way? thanks in advance. :)

Member Avatar
Member Avatar
+0 forum 8

I am new to vb.net Pls. Can someone help me on how do to display my data saved into sql server from form1 to datagridview in form2 with vb.net. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 1

Hey everyone, I am trying to create an excel spreadsheet that is populated with data from a table in sql server. I would like to make it so it will update several times a day with out the user having to do so. I have no clue how to go about this. I was hoping one of you could point me in the right direction. Thanks!

Member Avatar
Member Avatar
+0 forum 2

I have to make a database system that is purely on SQL Server. It's about a diagnostic lab. It should contain at least 40,000 distinct patient records. I have a table named "Patient" which contains an auto-generated ID, Name, DOB, Age and Phone number. Our teacher provided us with a dummy stored procedure which contained 2 temporary tables that has 200 names each and in the end he makes a Cartesian product which is supposed to give 40,000 distinct rows. I have used the same dummy stored procedure and modified it according to our table. But the rows inserted are …

Member Avatar
Member Avatar
+0 forum 1

SELECT Facility.[Facility Name] FROM Facility LEFT OUTER JOIN Reservation on Facility.FacilityID = [Reservation].FacilityID AND [Check-in time] = '" & Integer.Parse(cboHour.Text) & "' AND [Check-in date] = '" & lstDate.SelectedItem.ToString & "' WHERE Reservation].ReservationID Is NULL AND Facility.[Facility Type] = '" & cboFacilityType.Text & "' I have this sql statement which only return me the facilities that are available. The problem is, I wanted it to check for the check-out time as well. Eg, A user make a reservation on 3/11/2013 10am and the duration is 2 hours. When the another user make a reservation on 11am on the same date, …

Member Avatar
Member Avatar
+0 forum 16

Collapse | Copy Code int s1 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[3].Value); int s2 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[6].Value); int s3 = s1 * s2; dataGridView1.CurrentRow.Cells[38].Value = s3; this is working fine when i change the value lively in dataGridView1.CurrentRow.Cells[3] it multiply with the changed value with dataGridView1.CurrentRow.Cells[6] and display the value in dataGridView1.CurrentRow.Cells[38] like cell[3] cell[6] cell[38] 5 5 30 pls help thanks in advance

Member Avatar
Member Avatar
+0 forum 2

hi all. I want to fill the Listview from a mssql database in vb.net but it not show all the data in Listview. I have the followning code. Dim sSQL As String Dim lvwItem As New ListViewItem() sSQL = "SELECT field1, field2, field3 FROM tablenam e " sSQL = sSQL & "ORDER BY field1 " Dim command As New SqlCommand (sSQL, myConne ction) Dim reader As SqlDataR eader = command .Execute Reader() While reader.Read() lvwItem = ListView 1. Items. Add (reader.G etString (0)) lvwItem. SubItem s .Add (reader.G etString (1)) lvwItem. SubItem s .Add (reader.G etString (2)) End While End …

Member Avatar
Member Avatar
+0 forum 8

guys i need ur help i want to insert data directly into the sql table using c# here is my code all that i have been able to do is get the values from the table not insert them i tried to do it this way but apprently there is some thing wrong with this code plz help me out string sConnectionString = "Data Source=localhost;Initial Catalog=ScratchCardSystem2;Integrated Security=True;pooling=true"; SqlConnection objConn = new SqlConnection(sConnectionString); objConn.Open(); string query = "SELECT * FROM store_adj_note_detail_1"; SqlDataAdapter dAdapter = new SqlDataAdapter(query,objConn); SqlCommandBuilder cBuilder = new SqlCommandBuilder(dAdapter); DataTable dTable = new DataTable(); //fill the DataTable dAdapter.Fill(dTable); //the …

Member Avatar
Member Avatar
+0 forum 1

Hi First of all i would like to say is, i am a fresher to this vb.net.. having one project in hand. But as i dont know the code for using a datagridview i am asking your help. In my sqlserver table "EmployeeDetails" we have so many columns. In that Mainly the three Columns are "EmpName", Leave Allowed and Leave Balance. Here the employee has been restricted to take only 30 days leave in a month. Consider in a company they have % employee. 3 among them, worked on 2 days during Holidays. Employee A has 10 leave Balance and …

Member Avatar
+0 forum 0

The End.