jbisono 51 Posting Pro in Training

Ok once you have a connection set up, the easiest way to go is using a dataset you can basically do this. i did not test this.

Dim statement As String = "SELECT EmployeeId, FName FROM tblEmployee"
Dim adapt As New SqlDataAdapter(statement,connection)
Dim ds As New DataSet()
connection.Open()
adapt.Fill(ds)
connection.Close()
CmbEmployee.DataSource = ds
CmbEmployee.DisplayMember = "FName"
CmbEmployee.ValueMember = "EmployeeID"
CmbEmployee.DataBind()

regards.

jbisono 51 Posting Pro in Training

Hi,
What do you have so far? what is the part that you do not understand how to do it?.

regards.

jbisono 51 Posting Pro in Training

Good. take care.

jbisono 51 Posting Pro in Training

Glad to know that, take care.

jbisono 51 Posting Pro in Training

Well partner in c# i will do this, probably you can translate this to vb.

System.Text.StringBuilder sbScript = new System.Text.StringBuilder("");

            sbScript.Append("<script language='javascript'>");
            sbScript.Append("var w=0, h=0;");
            sbScript.Append("if(document.all || document.layers)");
            sbScript.Append("{");
            sbScript.Append("w=screen.availWidth;");
            sbScript.Append("h=screen.availHeight;");
            sbScript.Append("}");
            sbScript.Append("var popW = 900,");
            sbScript.Append("popH = 500;");
            sbScript.Append("var leftc = ( w - popW) / 2,");
            sbScript.Append("topc = (h - popH) / 2;");
            sbScript.Append("window.open('");
            sbScript.Append("http://www.google.com");
            sbScript.Append("', 'w_Locate',");
            sbScript.Append("'left='+leftc+',top='+topc+',width=900, height=500, menubar=yes, resizable=no');");
            sbScript.Append("w_Locate.focus();<");
            sbScript.Append("/script>");

            ScriptManager.RegisterStartupScript(this, this.GetType(), "@@@@MyPopUpScript", sbScript.ToString(), false);

Hope that help you.

jbisono 51 Posting Pro in Training

SELECT country_code, countries
FROM countries
WHERE (country_code NOT IN
(SELECT CountryCode
FROM allow))

ok so your statement should be like this.
regards.

jbisono 51 Posting Pro in Training

Ok, I think I am a little lost lets put some data into that table
COUNTRIES
USA - UNITED STATES
DR - DOMINICAN REPUBLIC
MX - MEXICO
PR - PUERTO RICO

ALLOW
DR
MX

So what you are saying is that in ALLOW table you can have multiple DR and MX?

jbisono 51 Posting Pro in Training

SELECT DISTINCT countries.Country_Code, Country_Name FROM countries INNER JOIN allow ON countries.Country_Code != allow.Country_Code ORDER BY Country_Name

What about that.

jbisono 51 Posting Pro in Training

try this. SELECT DISTINCT countries.Country_Code, Country_Name FROM countries, allow WHERE countries.Country_Code != allow.Country_Code ORDER BY Country_Name Regards.

jbisono 51 Posting Pro in Training

Well first of all you have a very nice understanding about db, in fact primary key in other words means, that specific piece of data that contain partnumberid cannot be repeated for the all history of that table.

As you said foreign key make reference, to another table in order to make a link between to tables you can have as much foreign key as you need it.

Back to primary key you can have multiple primary key in a single table but what should be the reason to select partnumberid and descriptionid as primary key, if the partnumberid is more than enough. if you set your table up correctly the db management system would not let you save a duplicate id ever.

a simple example when you have more than two primary keys in a simple table is "imagine have a order table, of course an order can have different products so you will have two tables one for the order header in another one to hold the products.

[U]Order[/U]
OrderId pk
Date
Client

[U]OrderLine[/U]
OrderId pk
Line pk
partid fk

Take care.

jbisono 51 Posting Pro in Training

Try that

SELECT     Profiles.answer, users.gender, COUNT(Profiles.answer) AS count
FROM         Profiles INNER JOIN
                      users ON users.userid = Profiles.userid
GROUP BY users.gender, Profiles.answer

Regards.

jbisono 51 Posting Pro in Training

U can use winrar for that.

regards.

jbisono 51 Posting Pro in Training

Excellent!!!.

jbisono 51 Posting Pro in Training

Good to know!!!.

jbisono 51 Posting Pro in Training

Let's go back to basic, you said before you had some virus and your pc, probably during the clean process you delete something that it is the culprit, is that is the case i will do a system repair if you have the cd.

Just to share some personal experience, once i had a similar problem with a mini dell, and i last 3 days working with a dell support guy and at the end, he just recommend me to make a fresh install, my lucky that computer is quite simple to backup, if it is not a really headache for you I will do the same thing.

Just a thought. take care.

jbisono 51 Posting Pro in Training

shutdown any firewall on, in order to test.
Try reinstall the program.
reboot in safe mode with network and try to update.

jbisono 51 Posting Pro in Training

Hi friends, I fixed the problem PreBina Variable was holding a hide delimiter character at the end of the string and that was stopping the correct function or result that i wanted. anyway I just did this.

PreBina.Remove(PreBina.Length -1,1)

now is happy. thanks anyway.

jbisono 51 Posting Pro in Training

no, but you will need to reinstall the windows updates.

regards.

jbisono 51 Posting Pro in Training

Try to rename the application and try to update.

regards.

jbisono 51 Posting Pro in Training

maybe this can help you lets say you want the subtract from two dates and then get the days.

DateTime dt = some date
TimeSpan ts = DateTime.Now - some date;
ts.Days // return the days

well any way you can find a lot information here

http://msdn.microsoft.com/en-us/library/system.datetime_methods(VS.71).aspx

http://msdn.microsoft.com/en-us/library/system.timespan_methods.aspx

Regards.

jbisono 51 Posting Pro in Training

Hi, you should open the connection cn.Open() and then cn.Close() also you have a problem and the insert statement you are calling label1.text as lable1.text.

besides that check your table and see what is the minimum parameters that you need to insert.

also i will create another connection call it conn

sqlcmd = New Sqlcommand ( "Select * from Staff_Main where Staff_id like '"&textbox1.text&"'",cn)
cn.Open()
dr = sqlcmd.executereader

while(dr.read())
{

sqlcmd = new sqlcommand ("insert into smart.dbo.event(e_staff_name) values '"+dr.GetString(1)+"'",conn)
conn.Open()
sqlcmd.executenonquesry
conn.Close()
}
dr.Close()
cn.Close()
jbisono 51 Posting Pro in Training

Can you show more code, beacuse I do not see the connection object something like this

Dim conn as New System.Data.SqlClient.SqlConnection(ConnectionString)

and then

conn.open()

jbisono 51 Posting Pro in Training

Hi, everyone this is my issue I have to read a binary record from the database and concatenate another string to it, the thing is that is just working one way, I ll put some code to explain better.

buffer = rdGetBinary.GetInt32(3);//this is the length of the actual row from the database.
                            byte[] outbyted = new byte[buffer];
                            startindex = 0;
                            retvale = rdGetBinary.GetBytes(2, startindex, outbyted, 0, buffer);
                            string bina = System.Text.Encoding.ASCII.GetString(outbyted);
                            string Combined = "";
                            Combined = bina.Replace("Q.A","Q.C")+ "\n\n" + PreBina; //which PreBina is another string variable, now this is working but if i do this Combined = PreBina + "\n\n" + bina.Replace("Q.A","Q.C") will not work.
                           
                            SqlCommand UpdateBinary = new SqlCommand();
                            long buffert = (long)Combined.Length;
                            byte[] photo = new byte[buffert];
                            photo = System.Text.Encoding.UTF8.GetBytes(Combined);
                            UpdateBinary.CommandText = "UPDATE OPERATION_BINARY SET BITS = @Photo, BITS_LENGTH = '" + photo.Length + "' WHERE WORKORDER_BASE_ID = '" + dsGetOperation.Tables[0].Rows[i][0].ToString() + "' AND WORKORDER_LOT_ID = '" + dsGetOperation.Tables[0].Rows[i][1].ToString() + "' AND WORKORDER_TYPE = 'M' AND SEQUENCE_NO = '" + PreSeq + "'";
                            UpdateBinary.Connection = conne;
                            UpdateBinary.Parameters.Add("@Photo", SqlDbType.Image, photo.Length).Value = photo;
                            conne.Open();
                            UpdateBinary.ExecuteNonQuery();
                            conne.Close();

I really do not understand this behavior, I just post it just in case somebody occasionally have had this issue before.

Thanks all.

jbisono 51 Posting Pro in Training

Ok, guys thanks for your help, I did a fresh install, thanks again.

regards.

jbisono 51 Posting Pro in Training

well due, I think you should break down a little bit your problem.
first of all I will get a piece of paper and draw the easy steps, for example. draw the 3 floors with the capacity of each room, then try to accommodate every computer and each room base on groups, keeping in mind the printers for groups and personal use.
after that you should be asking questions like, in what floor is secure put the database server or the authentication server and why?

I think that friends around this neighbor will help you better.

regards.

jbisono 51 Posting Pro in Training

Interesting, now i have two different feedback, HITMANOF44th and rik from rce. I am agree with rik but i was not 100% sure.
anyway if someone else have something to say i really appreciate it.

regards.

jbisono 51 Posting Pro in Training

11 or 12? well here says media center edition 2005.

jbisono 51 Posting Pro in Training

ok i have the media center key, so I won't have any problem. thanks for your quick reply.

jbisono 51 Posting Pro in Training

Hi, Can I make a repair windows with any windows xp cd? in my case i want to repair a machine that is running windows xp media center but i have a windows xp professional is there any issue with that?

jbisono 51 Posting Pro in Training

I tried the first two suggestions but got the same error, the third one adatapost resolved my issue thanks all.

jbisono 51 Posting Pro in Training

Hi forgive if i am posting in the wrong forum, my issue is this, i want to be able to stream audio over http from my computer lets say play what im listen in windows media player or winamp or any player.
I wonder if there is any script to achieve this. without using Icecast or any of those server out there. or of course if there is another way to go to get this working i ll be more than glad reading it.

Thanks for any suggestions.

jbisono 51 Posting Pro in Training

Ok I have seen to many post about this and nothing work for me, I just do not get it. I have a simple datagrid which i want to add rows, NOTE: this datagrid have no relation with database so everything has to be done datatable or arraylist whatever you want to help me.

Im going to post a few lines of what i have so far.

<asp:DataGrid ID="dgHistoric" runat="server" ShowFooter="true" AutoGenerateColumns="false" OnItemCommand="InsertSaveHist" >
                        <Columns>
                            <asp:TemplateColumn HeaderText="OSR">
                                <ItemTemplate>
                                    <asp:Label ID="txtHisOsr" runat="server" Width="25" Text='<% #DataBinder.Eval(Container.DataItem, "Opsheetrev").ToString() %>'></asp:Label>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox ID="txtFHisOsr" runat="server" Width="25"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateColumn>
                             <asp:TemplateColumn HeaderText="Eng Dwg Rev.">
                                <ItemTemplate>
                                    <asp:Label ID="txtHisEdr" runat="server" Width="25" Text='<% #DataBinder.Eval(Container.DataItem, "Engdwgrev").ToString() %>'></asp:Label>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox ID="txtFHisEdr" runat="server" Width="25"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateColumn>
 <asp:TemplateColumn>
                                <FooterTemplate>
                                    <asp:Button ID="btnAddHis" runat="server" Text="Add" CommandName="InsertHist" />
                                </FooterTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                    </asp:DataGrid>

now in the load page function i have this because i want the first row blank.

DataTable dtOpe = new DataTable();
                DataSet dsComp = new DataSet();
       
                DataRow drOpe;
                dtOpe.Columns.Add("Opsheetrev");
                dtOpe.Columns.Add("Engdwgrev");
                drOpe = dtOpe.NewRow();
                drOpe[0] = "";
                drOpe[1] = "";
                dtOpe.Rows.Add(drOpe);
                dsComp.Tables.Add(dtOpe);
                dgHistoric.DataSource = dsComp;
                dgHistoric.DataBind();

and finally the insert function

DataSet dsComp = new DataSet();
                DataTable dt = (DataTable)dgHistoric.DataSource;
                
                DataRow dr = dt.NewRow();
                string osr = ((TextBox)e.Item.Cells[0].FindControl("txtFHisOsr")).Text;
                string edr = ((TextBox)e.Item.Cells[1].FindControl("txtFHisEdr")).Text;
             
                dr[0] = osr;
                dr[1] = edr;
                dt.Rows.Add(dr);
                dsComp.Tables.Add(dt);
                dgHistoric.DataSource = dt;
                dgHistoric.DataBind();

an error is generated in this point DataRow dr = dt.NewRow(); saying NullReferenceException was unhandled by user code.

thanks in advance for any help.

jbisono 51 Posting Pro in Training

when you got the black screen did you try to press ctrl+alt+del and see what happen. if did go to windows task manager then file -> New Task (Run...) and type C:\WINDOWS\explorer.exe and click ok if that work check this thread http://www.daniweb.com/forums/showthread.php?t=39613&highlight=explorer.exe+not+starting

jbisono 51 Posting Pro in Training

You can go to this link for more reference.

http://www.connectionstrings.com/
http://www.daniweb.com/forums/thread272.html

In a nut shell you need this

Dim cn As OleDbConnection
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;_
Data Source=Path to your database;")

path to your database could be the computer that has the share database. be sure to give the correct rights to the database probably read and write. and of course make sure all users in the local network has access to the folder which the DataBase is.

Hope that helps regards.

jbisono 51 Posting Pro in Training

Try to repost your select statement between tags because I cannot even seen it.

jbisono 51 Posting Pro in Training

Just double check this, I am not sure. but when you say this For i As Integer = 1 To CheckBoxList2.Items.Count I think the checkboxlist index start in 0.

jbisono 51 Posting Pro in Training

You right :).

jbisono 51 Posting Pro in Training

Make sure your dropdownlist does not have duplicate values, for example if you result set when you bind the sub category dropdownlist have a duplicate value, when postback is going to go back to first position because your value must be unique, verify that first and then tell us, what happened. to be more straightforward check this field M_PAGES_ID_PK when you bind the sub category dropdown.

Regards.

jbisono 51 Posting Pro in Training

Ok, thanks for your help.

jbisono 51 Posting Pro in Training

Well what I mean is that I do not have like a specific string to search all the documents has data at least the header, now what i know is that column 1 = Drawing Revision for example in the table column2 = Paper Revision and so on. that is why I am interesting to go over every single row and column because for me it is easier to retrieve the values, sorry if I am not explaining this issue correctly but that is it, for my bad lucky there is no consistency in the word documents make the automatic read kind of difficult.
Thanks.

jbisono 51 Posting Pro in Training

Yes, I understand your point, but the problem is that I do not have any specific parameter to search into the document, the data could be any, like a I said before the only thing I know is that the data i want is into table, but now the documents have different structure. what i thinking to do is, go for every single word document and verify if it have a table and then get my data and move that document to another location and see how many word document i have left. and pass the data manually to the database.

Thanks again for your help.

jbisono 51 Posting Pro in Training

Thanks Serkan.
Base on your link, I came out with this code, which can read the table as I want, thanks again.

Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.ApplicationClass();
            app.Visible = false;
            object nullobj = System.Reflection.Missing.Value;
            object file = path;
            Microsoft.Office.Interop.Word.Document doc = app.Documents.Open(
            ref file, ref nullobj, ref nullobj,
            ref nullobj, ref nullobj, ref nullobj,
            ref nullobj, ref nullobj, ref nullobj,
            ref nullobj, ref nullobj, ref nullobj,
            ref nullobj, ref nullobj, ref nullobj, ref nullobj);
            Microsoft.Office.Interop.Word.Table tbl = doc.Tables[1];
            doc.ActiveWindow.Selection.WholeStory();
            doc.ActiveWindow.Selection.Copy();
            IDataObject data = Clipboard.GetDataObject();
            string text = data.GetData(DataFormats.Text).ToString();
            //with this I go for every single row, and my case the tables always have 5 columns.
            [B] for (int i = 1; i < tbl.Rows.Count; i++)
            {
                for (int a = 1; a < 5; a++)
                {
                    textBox1.Text += tbl.Cell(i, a).Range.Text + Environment.NewLine;
                }
            }[/B]

But now, I do not know why if I open the document with Microsoft Word I can see there is a table, but the programming not recognize the table, this just happen in some word documents not all. the things is that i have thousands of word documents that i have to go thru and get the info that i want.

anyway base on my first problem you did answer my question, but i would like to know any opinion about my second issue.

regards, thanks again.

jbisono 51 Posting Pro in Training

Hi,

SELECT A.AID, B.BID, A.ANAME, B.BDESC FROM A INNER JOIN B ON A.AID = B.AID

Hope that help regards.

jbisono 51 Posting Pro in Training

Glad to know you are in the road.

You can do this also replacing the textbox1.text in the insert statement by @name and so one and then add this line for every single parameter

cmdNcr.Parameters.Add("@name", SqlDbType.VarChar).Value = TextBox1.Text;

and so on.

Take care.

jbisono 51 Posting Pro in Training

Hi, Guys.

I have a issue reading a word document, well i can actually read the document but i need some how split some data into array, now the data that i want to split is into a table in word, is there an easy way to split that data into array from the table in word?. Because my big problem is that somehow when i read it, i get different result structure, what i mean is that sometimes i receive every single row in lines and others just as it is in columns. in summary my result from word it is not always the same so i cannot play with it. what i know is that the data i want is into a table.

I know office 2003 is saved in binary but 2007 saved in ooxml so is make any easy to work that way, i do not have any problem to convert all files into 2007 and work with that.

I hope you guys understand what my issue is thanks.

jbisono 51 Posting Pro in Training

well if you cannot get into windows at all, try booting in safe mode, Press F8 at the beginning and select Safe Mode, If you can start your machine thru that, is there any recently software or driver update that you have installed, uninstall it, also run antivirus scan, do it step by step and try boot as normal.

Hope that help, if non report back how far can you get thru safe mode.

regards

jbisono 51 Posting Pro in Training

Well, if you said it was working, the first thing i can think is check the path, is something change?

Regards.

jbisono 51 Posting Pro in Training

In a nut shell, you want to make two queries and then put them together in a datagrid result, if that is the case, i supposed that both queries contain the same fields, you can use UNION between two statement and just past one result set to the datagrid. because I understand you want both result set in a single datagridview so the statement is going to look like this.

Select Name, LastName from Person
Union
Select Name, LastName from Vendor

Take care.

jbisono 51 Posting Pro in Training

this link http://www.fonerbooks.com/laptop18.htm show you where the memory ram in a laptop is located, open it and check how many RAM you have stick and the laptop, and if you have two try the suggestion above.

jbisono 51 Posting Pro in Training

If you have more than one memory ram stick in your motherboard, try test one by one swaping the ram, at least if it is a ram related issue then you know what to do.

Regards.